|
4 | 4 | import * as uuid from 'uuid/v4';
|
5 | 5 | import { CancellationToken, Event, EventEmitter } from 'vscode';
|
6 | 6 |
|
| 7 | +import { nbformat } from '@jupyterlab/coreutils'; |
7 | 8 | import { ILiveShareApi, IWorkspaceService } from '../../common/application/types';
|
8 | 9 | import { Cancellation } from '../../common/cancellation';
|
9 | 10 | import { traceInfo } from '../../common/logger';
|
@@ -248,7 +249,9 @@ export class JupyterExecutionBase implements IJupyterExecution {
|
248 | 249 | // If our uri is undefined or if it's set to local launch we need to launch a server locally
|
249 | 250 | if (!options || !options.uri) {
|
250 | 251 | traceInfo(`Launching ${options ? options.purpose : 'unknown type of'} server`);
|
251 |
| - const launchResults = await this.startNotebookServer(options && options.useDefaultConfig ? true : false, cancelToken); |
| 252 | + const useDefaultConfig = options && options.useDefaultConfig ? true : false; |
| 253 | + const metadata = options?.metadata; |
| 254 | + const launchResults = await this.startNotebookServer({useDefaultConfig, metadata}, cancelToken); |
252 | 255 | if (launchResults) {
|
253 | 256 | connection = launchResults.connection;
|
254 | 257 | kernelSpec = launchResults.kernelSpec;
|
@@ -284,11 +287,11 @@ export class JupyterExecutionBase implements IJupyterExecution {
|
284 | 287 |
|
285 | 288 | // tslint:disable-next-line: max-func-body-length
|
286 | 289 | @captureTelemetry(Telemetry.StartJupyter)
|
287 |
| - private async startNotebookServer(useDefaultConfig: boolean, cancelToken?: CancellationToken): Promise<{ connection: IConnection; kernelSpec: IJupyterKernelSpec | undefined }> { |
| 290 | + private async startNotebookServer(options: {useDefaultConfig: boolean; metadata?: nbformat.INotebookMetadata}, cancelToken?: CancellationToken): Promise<{ connection: IConnection; kernelSpec: IJupyterKernelSpec | undefined }> { |
288 | 291 | // First we find a way to start a notebook server
|
289 | 292 | const notebookCommand = await this.findBestCommand(JupyterCommands.NotebookCommand, cancelToken);
|
290 | 293 | this.checkNotebookCommand(notebookCommand);
|
291 |
| - return this.notebookStarter.start(useDefaultConfig, cancelToken); |
| 294 | + return this.notebookStarter.start(options, cancelToken); |
292 | 295 | }
|
293 | 296 |
|
294 | 297 | private getUsableJupyterPythonImpl = async (cancelToken?: CancellationToken): Promise<PythonInterpreter | undefined> => {
|
|
0 commit comments