Change cell execution/cancel API

Fix #99203
This commit is contained in:
Rob Lourens
2020-07-20 14:43:12 -07:00
parent 357fe6956c
commit 90363c2f9d
14 changed files with 242 additions and 136 deletions

View File

@@ -62,7 +62,7 @@ export function activate(context: vscode.ExtensionContext): any {
context.subscriptions.push(vscode.notebook.registerNotebookKernel('notebookKernelTest', ['*.vsctestnb'], {
label: 'Notebook Test Kernel',
executeAllCells: async (_document: vscode.NotebookDocument, _token: vscode.CancellationToken) => {
executeAllCells: async (_document: vscode.NotebookDocument) => {
let cell = _document.cells[0];
cell.outputs = [{
@@ -73,7 +73,8 @@ export function activate(context: vscode.ExtensionContext): any {
}];
return;
},
executeCell: async (document: vscode.NotebookDocument, cell: vscode.NotebookCell | undefined, _token: vscode.CancellationToken) => {
cancelAllCellsExecution: async (_document: vscode.NotebookDocument) => { },
executeCell: async (document: vscode.NotebookDocument, cell: vscode.NotebookCell | undefined) => {
if (!cell) {
cell = document.cells[0];
}
@@ -113,7 +114,8 @@ export function activate(context: vscode.ExtensionContext): any {
}
});
return;
}
},
cancelCellExecution: async (_document: vscode.NotebookDocument, _cell: vscode.NotebookCell) => { }
}));
const preloadUri = vscode.Uri.file(path.resolve(__dirname, '../src/customRenderer.js'));