MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / start

Method start

src/kernels/execution/codeExecution.ts:76–102  ·  view source on GitHub ↗
(session: IKernelSession)

Source from the content-addressed store, hash-verified

74 return new CodeExecution(code, extensionId);
75 }
76 public async start(session: IKernelSession) {
77 this.session = session;
78 if (this.cancelHandled) {
79 traceExecMessage(this.extensionId, this.executionId, 'Not starting as it was cancelled');
80 return;
81 }
82 traceExecMessage(this.extensionId, this.executionId, 'Start Code execution');
83 logger.ci(`Code Exec contents ${this.code.substring(0, 50)}...`);
84 if (!session.kernel || session.kernel.isDisposed || session.isDisposed) {
85 this._done.reject(new SessionDisposedError());
86 return;
87 }
88
89 if (this.started) {
90 traceExecMessage(
91 this.extensionId,
92 this.executionId,
93 'Code has already been started yet CodeExecution.Start invoked again'
94 );
95 logger.error(`Code has already been started yet CodeExecution.Start invoked again ${this.executionId}`);
96 // TODO: Send telemetry this should never happen, if it does we have problems.
97 return this.done;
98 }
99
100 // Begin the request that will modify our cell.
101 await this.execute(this.code.replace(/\r\n/g, '\n'), session).catch(noop);
102 }
103
104 /**
105 * Cancel execution.

Callers

nothing calls this directly

Calls 6

executeMethod · 0.95
traceExecMessageFunction · 0.85
ciMethod · 0.65
rejectMethod · 0.65
errorMethod · 0.65
replaceMethod · 0.45

Tested by

no test coverage detected