(providerId: string, handle: string, serviceContainer: IServiceContainer)
| 92 | return kernelServiceFactory.getService(); |
| 93 | } |
| 94 | export async function addRemoteJupyterServer(providerId: string, handle: string, serviceContainer: IServiceContainer) { |
| 95 | const extensions = serviceContainer.get<IExtensions>(IExtensions); |
| 96 | logger.error( |
| 97 | 'The API addRemoteJupyterServer has being deprecated and will be removed soon, please use createJupyterServerCollection.' |
| 98 | ); |
| 99 | const extensionId = extensions.determineExtensionFromCallStack().extensionId; |
| 100 | if (extensionId.toLowerCase() != CodespaceExtensionId.toLowerCase()) { |
| 101 | throw new Error('Deprecated API'); |
| 102 | } |
| 103 | sendTelemetryEvent(Telemetry.JupyterApiUsage, undefined, { |
| 104 | clientExtId: extensionId, |
| 105 | pemUsed: 'addRemoteJupyterServer' |
| 106 | }); |
| 107 | |
| 108 | const selector = serviceContainer.get<CodespacesJupyterServerSelector>(CodespacesJupyterServerSelector); |
| 109 | |
| 110 | const controllerRegistration = serviceContainer.get<IControllerRegistration>(IControllerRegistration); |
| 111 | const controllerCreatedPromise = waitForNotebookControllersCreationForServer( |
| 112 | { id: providerId, handle }, |
| 113 | controllerRegistration |
| 114 | ); |
| 115 | await selector.addJupyterServer({ id: providerId, handle, extensionId }); |
| 116 | await controllerCreatedPromise; |
| 117 | } |
| 118 | |
| 119 | export async function openNotebook( |
| 120 | uri: Uri, |
no test coverage detected