mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
add NotebookCell#index, https://github.com/microsoft/vscode/issues/106637
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user