remove old notebookCellExecutionState proposal (#248522)

re https://github.com/microsoft/vscode/issues/124970#issuecomment-2864279668
This commit is contained in:
Johannes Rieken
2025-05-12 02:36:15 +02:00
committed by GitHub
parent c6baa8f4ad
commit e29c92acaf
8 changed files with 3 additions and 132 deletions

View File

@@ -278,38 +278,6 @@ const apiTestSerializer: vscode.NotebookSerializer = {
});
});
test('onDidChangeCellExecutionState is fired', async () => {
const notebook = await openRandomNotebookDocument();
const editor = await vscode.window.showNotebookDocument(notebook);
const cell = editor.notebook.cellAt(0);
let eventCount = 0;
const def = new DeferredPromise<void>();
testDisposables.push(vscode.notebooks.onDidChangeNotebookCellExecutionState(e => {
try {
assert.strictEqual(e.cell.document.uri.toString(), cell.document.uri.toString(), 'event should be fired for the executing cell');
if (eventCount === 0) {
assert.strictEqual(e.state, vscode.NotebookCellExecutionState.Pending, 'should be set to Pending');
} else if (eventCount === 1) {
assert.strictEqual(e.state, vscode.NotebookCellExecutionState.Executing, 'should be set to Executing');
assert.strictEqual(cell.outputs.length, 0, 'no outputs yet: ' + JSON.stringify(cell.outputs[0]));
} else if (e.state === vscode.NotebookCellExecutionState.Idle) {
assert.strictEqual(cell.outputs.length, 1, 'should have an output');
def.complete();
}
eventCount++;
} catch (err) {
def.error(err);
}
}));
vscode.commands.executeCommand('notebook.cell.execute', { document: notebook.uri, ranges: [{ start: 0, end: 1 }] });
await def.p;
});
test('Output changes are applied once the promise resolves', async function () {
let called = false;