Fix #98841. Open file should only emit document open event, no cells change event.

This commit is contained in:
rebornix
2020-06-02 15:13:15 -07:00
parent 8e45a2f4b5
commit adae0e5b4e
5 changed files with 58 additions and 26 deletions

View File

@@ -278,6 +278,23 @@ suite('API tests', () => {
await vscode.commands.executeCommand('workbench.action.files.save');
await vscode.commands.executeCommand('workbench.action.closeActiveEditor');
});
test('initialzation should not emit cell change events.', async function () {
const resource = vscode.Uri.file(join(vscode.workspace.rootPath || '', './first.vsctestnb'));
let count = 0;
const disposables: vscode.Disposable[] = [];
disposables.push(vscode.notebook.onDidChangeNotebookCells(() => {
count++;
}));
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
assert.equal(count, 0);
disposables.forEach(d => d.dispose());
await vscode.commands.executeCommand('workbench.action.files.save');
await vscode.commands.executeCommand('workbench.action.closeActiveEditor');
});
});
suite('notebook workflow', () => {