This commit is contained in:
Johannes Rieken
2020-09-14 10:39:43 +02:00
parent b9291026a6
commit 933bdbc296
3 changed files with 52 additions and 0 deletions

View File

@@ -115,6 +115,7 @@ export class ExtHostCell extends Disposable {
const that = this;
const document = this._extHostDocument.getDocument(this.uri)!.document;
this._cell = Object.freeze({
get index() { return that._notebook.getCellIndex(that); },
notebook: that._notebook.notebookDocument,
uri: that.uri,
cellKind: this._cellData.cellKind,
@@ -487,6 +488,9 @@ export class ExtHostNotebookDocument extends Disposable {
return this._cells.find(cell => cell.handle === cellHandle);
}
getCellIndex(cell: ExtHostCell): number {
return this._cells.indexOf(cell);
}
addEdit(item: vscode.NotebookDocumentEditEvent): number {
return this._edits.add([item]);