execute by cell-handle, kernel manager has only execute/cancel cells, also "fix" isNotebookCellData fyi @rebornix

This commit is contained in:
Johannes Rieken
2021-04-20 14:39:19 +02:00
parent 0b46219a2d
commit b2b45e1005
11 changed files with 114 additions and 191 deletions

View File

@@ -635,17 +635,17 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
createNotebookCellExecution(docUri: vscode.Uri, index: number, kernelId: string): vscode.NotebookCellExecutionTask | undefined {
const document = this.lookupNotebookDocument(docUri);
if (!document) {
throw new Error(`Invalid cell uri / index: ${docUri}, ${index} `);
throw new Error(`Invalid uri: ${docUri} `);
}
const cell = document.getCellFromIndex(index);
if (!cell) {
throw new Error(`Invalid cell uri / index: ${docUri}, ${index} `);
throw new Error(`Invalid cell index: ${docUri}, ${index} `);
}
// TODO@roblou also validate kernelId, once kernel has moved from editor to document
if (this._activeExecutions.has(cell.uri)) {
return;
throw new Error(`duplicate execution for ${cell.uri}`);
}
const execution = new NotebookCellExecutionTask(docUri, document, cell, this._notebookDocumentsProxy);