提交 cfe2bb23 编写于 作者: J Johannes Rieken

chore - remove ExtHostNotebookEditor#uri and use document.uri instead

上级 82ac7bac
......@@ -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;
......
......@@ -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<any> = 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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册