diff --git a/src/vs/workbench/api/common/extHostNotebook.ts b/src/vs/workbench/api/common/extHostNotebook.ts index d621d311119..c1944e6064a 100644 --- a/src/vs/workbench/api/common/extHostNotebook.ts +++ b/src/vs/workbench/api/common/extHostNotebook.ts @@ -529,7 +529,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape, ExtHostN const uriStr = URI.revive(uriComponents).toString(); let editor: { editor: ExtHostNotebookEditor; } | undefined; this._editors.forEach(e => { - if (e.editor.uri.toString() === uriStr) { + if (e.editor.document.uri.toString() === uriStr) { editor = e; } }); @@ -619,9 +619,8 @@ export class ExtHostNotebookController implements ExtHostNotebookShape, ExtHostN } const editor = new ExtHostNotebookEditor( - document.notebookDocument.viewType, editorId, - revivedUri, + document.notebookDocument.viewType, this._proxy, webComm.contentProviderComm, document @@ -656,7 +655,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape, ExtHostN } for (const e of this._editors.values()) { - if (e.editor.uri.toString() === revivedUri.toString()) { + if (e.editor.document.uri.toString() === revivedUri.toString()) { e.editor.dispose(); this._editors.delete(e.editor.id); editorChanged = true; diff --git a/src/vs/workbench/api/common/extHostNotebookEditor.ts b/src/vs/workbench/api/common/extHostNotebookEditor.ts index 2822cb39e30..f12f9f4f78e 100644 --- a/src/vs/workbench/api/common/extHostNotebookEditor.ts +++ b/src/vs/workbench/api/common/extHostNotebookEditor.ts @@ -6,7 +6,6 @@ import { readonly } from 'vs/base/common/errors'; import { Emitter, Event } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; import { CellKind, MainThreadNotebookShape } from 'vs/workbench/api/common/extHost.protocol'; import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; import { addIdToOutput, CellEditType, ICellEditOperation, ICellReplaceEdit, INotebookEditData, NotebookDocumentMetadata, notebookDocumentMetadataDefaults } from 'vs/workbench/contrib/notebook/common/notebookCommon'; @@ -125,12 +124,11 @@ export class ExtHostNotebookEditor extends Disposable implements vscode.Notebook readonly onDidReceiveMessage: vscode.Event = this._onDidReceiveMessage.event; constructor( - private readonly viewType: string, readonly id: string, - public uri: URI, - private _proxy: MainThreadNotebookShape, - private _webComm: vscode.NotebookCommunication, - public readonly notebookData: ExtHostNotebookDocument, + private readonly _viewType: string, + private readonly _proxy: MainThreadNotebookShape, + private readonly _webComm: vscode.NotebookCommunication, + readonly notebookData: ExtHostNotebookDocument, ) { super(); this._register(this._webComm.onDidReceiveMessage(e => { @@ -236,7 +234,7 @@ export class ExtHostNotebookEditor extends Disposable implements vscode.Notebook compressedEditsIndex++; } - return this._proxy.$tryApplyEdits(this.viewType, this.uri, editData.documentVersionId, compressedEdits, editData.newMetadata); + return this._proxy.$tryApplyEdits(this._viewType, this.document.uri, editData.documentVersionId, compressedEdits, editData.newMetadata); } revealRange(range: vscode.NotebookCellRange, revealType?: extHostTypes.NotebookEditorRevealType) {