diff --git a/extensions/vscode-notebook-tests/src/notebook.test.ts b/extensions/vscode-notebook-tests/src/notebook.test.ts index 062c55cb1cb..d512d5e0ff0 100644 --- a/extensions/vscode-notebook-tests/src/notebook.test.ts +++ b/extensions/vscode-notebook-tests/src/notebook.test.ts @@ -328,7 +328,7 @@ suite('metadata', () => { await waitFor(500); assert.equal(vscode.notebook.activeNotebookEditor !== undefined, true, 'notebook first'); - assert.equal(vscode.notebook.activeNotebookEditor!.document.metadata.custom['testMetadata'] as boolean, false); + assert.equal(vscode.notebook.activeNotebookEditor!.document.metadata.custom!['testMetadata'] as boolean, false); assert.equal(vscode.notebook.activeNotebookEditor!.selection?.metadata.custom!['testCellMetadata'] as number, 123); assert.equal(vscode.notebook.activeNotebookEditor!.selection?.language, 'typescript'); }); diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 48556963886..ddc152deb05 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1642,9 +1642,9 @@ declare module 'vscode' { displayOrder?: GlobPattern[]; /** - * Additional attributes of a cell metadata. + * Additional attributes of the document metadata. */ - [key: string]: any; + custom?: { [key: string]: any }; } export interface NotebookDocument { @@ -1685,7 +1685,9 @@ declare module 'vscode' { * The primary selected cell on this notebook editor. */ readonly selection?: NotebookCell; + viewColumn?: ViewColumn; + /** * Fired when the output hosting webview posts a message. */ diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditor.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditor.ts index 93173d625e2..c6e063464b0 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookEditor.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookEditor.ts @@ -124,6 +124,7 @@ export class NotebookEditor extends BaseEditor { } clearInput(): void { + // de-ref widget super.clearInput(); } diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts index af58a89697b..3fc6eb2d78d 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts @@ -119,6 +119,7 @@ export class NotebookEditorInput extends EditorInput { return this._move(group, target)?.editor; } + // called when users rename a notebook document move(group: GroupIdentifier, target: URI): IMoveResult | undefined { if (this.textModel) { const contributedNotebookProviders = this.notebookService.getContributedNotebookProviders(target);