-
Notifications
You must be signed in to change notification settings - Fork 313
/
Copy pathserviceRegistry.node.ts
122 lines (116 loc) · 6.2 KB
/
serviceRegistry.node.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ITracebackFormatter } from '../kernels/types';
import { IJupyterVariables } from '../kernels/variables/types';
import { IExtensionSyncActivationService } from '../platform/activation/types';
import { Identifiers } from '../platform/common/constants';
import { IDataScienceCommandListener } from '../platform/common/types';
import { IServiceManager } from '../platform/ioc/types';
import { InstallPythonControllerCommands } from './controllers/commands/installPythonControllerCommands';
import { LiveKernelSwitcher } from './controllers/liveKernelSwitcher';
import { NotebookIPyWidgetCoordinator } from './controllers/notebookIPyWidgetCoordinator';
import { RemoteKernelConnectionHandler } from './controllers/remoteKernelConnectionHandler';
import { RemoteKernelControllerWatcher } from './controllers/remoteKernelControllerWatcher';
import { registerTypes as registerControllerTypes } from './controllers/serviceRegistry.node';
import { CommandRegistry } from './debugger/commandRegistry';
import { DebuggerVariableRegistration } from './debugger/debuggerVariableRegistration.node';
import { DebuggerVariables } from './debugger/debuggerVariables';
import { DebuggingManager } from './debugger/debuggingManager';
import {
IDebuggingManager,
IDebugLocationTracker,
IDebugLocationTrackerFactory,
IJupyterDebugService,
INotebookDebuggingManager
} from './debugger/debuggingTypes';
import { DebugLocationTrackerFactory } from './debugger/debugLocationTrackerFactory';
import { JupyterDebugService } from './debugger/jupyterDebugService.node';
import { MultiplexingDebugService } from './debugger/multiplexingDebugService';
import { ExportBase } from './export/exportBase.node';
import { ExportInterpreterFinder } from './export/exportInterpreterFinder.node';
import { ExportUtil } from './export/exportUtil.node';
import { FileConverter } from './export/fileConverter.node';
import { IExportBase, IExportUtil, IFileConverter } from './export/types';
import { NotebookCellLanguageService } from './languages/cellLanguageService';
import { EmptyNotebookCellLanguageService } from './languages/emptyNotebookCellLanguageService';
import { NotebookCommandListener } from './notebookCommandListener';
import { NotebookEditorProvider } from './notebookEditorProvider';
import { NotebookPythonEnvironmentService } from './notebookEnvironmentService.node';
import { CellOutputMimeTypeTracker } from './outputs/jupyterCellOutputMimeTypeTracker';
import { NotebookTracebackFormatter } from './outputs/tracebackFormatter';
import { InterpreterPackageTracker } from './telemetry/interpreterPackageTracker.node';
import { INotebookEditorProvider, INotebookPythonEnvironmentService } from './types';
export function registerTypes(serviceManager: IServiceManager, isDevMode: boolean) {
registerControllerTypes(serviceManager, isDevMode);
serviceManager.addSingleton<IExtensionSyncActivationService>(IExtensionSyncActivationService, LiveKernelSwitcher);
serviceManager.addSingleton<IDataScienceCommandListener>(IDataScienceCommandListener, NotebookCommandListener);
serviceManager.addSingleton<INotebookEditorProvider>(INotebookEditorProvider, NotebookEditorProvider);
serviceManager.addSingleton<IExtensionSyncActivationService>(
IExtensionSyncActivationService,
RemoteKernelControllerWatcher
);
serviceManager.addSingleton<ITracebackFormatter>(ITracebackFormatter, NotebookTracebackFormatter);
serviceManager.addSingleton<IJupyterDebugService>(
IJupyterDebugService,
JupyterDebugService,
Identifiers.RUN_BY_LINE_DEBUGSERVICE
);
serviceManager.addSingleton<NotebookIPyWidgetCoordinator>(
NotebookIPyWidgetCoordinator,
NotebookIPyWidgetCoordinator
);
serviceManager.addBinding(NotebookIPyWidgetCoordinator, IExtensionSyncActivationService);
serviceManager.addSingleton<IExtensionSyncActivationService>(
IExtensionSyncActivationService,
RemoteKernelConnectionHandler
);
serviceManager.addSingleton<IExtensionSyncActivationService>(
IExtensionSyncActivationService,
InterpreterPackageTracker
);
serviceManager.addSingleton<IExtensionSyncActivationService>(
IExtensionSyncActivationService,
InstallPythonControllerCommands
);
serviceManager.addSingleton<NotebookCellLanguageService>(NotebookCellLanguageService, NotebookCellLanguageService);
serviceManager.addBinding(NotebookCellLanguageService, IExtensionSyncActivationService);
serviceManager.addSingleton<IExtensionSyncActivationService>(
IExtensionSyncActivationService,
EmptyNotebookCellLanguageService
);
// Debugging
serviceManager.addSingleton<IDebuggingManager>(INotebookDebuggingManager, DebuggingManager, undefined, [
IExtensionSyncActivationService
]);
serviceManager.addSingleton<IExtensionSyncActivationService>(
IExtensionSyncActivationService,
DebuggerVariableRegistration
);
serviceManager.addSingleton<IJupyterVariables>(
IJupyterVariables,
DebuggerVariables,
Identifiers.DEBUGGER_VARIABLES
);
serviceManager.addSingleton<IJupyterDebugService>(
IJupyterDebugService,
MultiplexingDebugService,
Identifiers.MULTIPLEXING_DEBUGSERVICE
);
serviceManager.addSingleton<IDebugLocationTracker>(IDebugLocationTracker, DebugLocationTrackerFactory, undefined, [
IDebugLocationTrackerFactory
]);
serviceManager.addSingleton<IExtensionSyncActivationService>(IExtensionSyncActivationService, CommandRegistry);
serviceManager.addSingleton<IExtensionSyncActivationService>(
IExtensionSyncActivationService,
CellOutputMimeTypeTracker
);
// File export/import
serviceManager.addSingleton<IFileConverter>(IFileConverter, FileConverter);
serviceManager.addSingleton<ExportInterpreterFinder>(ExportInterpreterFinder, ExportInterpreterFinder);
serviceManager.addSingleton<IExportBase>(IExportBase, ExportBase);
serviceManager.addSingleton<IExportUtil>(IExportUtil, ExportUtil);
serviceManager.addSingleton<NotebookPythonEnvironmentService>(
INotebookPythonEnvironmentService,
NotebookPythonEnvironmentService
);
}