提交 054cbf4f 编写于 作者: J Johannes Rieken

export onDidChange-event in concat-doc

上级 10655296
...@@ -1671,6 +1671,7 @@ declare module 'vscode' { ...@@ -1671,6 +1671,7 @@ declare module 'vscode' {
} }
export interface NotebookConcatTextDocument { export interface NotebookConcatTextDocument {
onDidChange: Event<void>;
version: number; version: number;
getText(): string; getText(): string;
getText(range: Range): string; getText(range: Range): string;
......
...@@ -23,8 +23,8 @@ export class ExtHostNotebookConcatDocument implements vscode.NotebookConcatTextD ...@@ -23,8 +23,8 @@ export class ExtHostNotebookConcatDocument implements vscode.NotebookConcatTextD
private _cellLines!: PrefixSumComputer; private _cellLines!: PrefixSumComputer;
private _versionId = 0; private _versionId = 0;
private readonly _onDidChange = new Emitter<this>(); private readonly _onDidChange = new Emitter<void>();
readonly onDidChange: Event<this> = this._onDidChange.event; readonly onDidChange: Event<void> = this._onDidChange.event;
constructor( constructor(
extHostNotebooks: ExtHostNotebookController, extHostNotebooks: ExtHostNotebookController,
...@@ -40,14 +40,14 @@ export class ExtHostNotebookConcatDocument implements vscode.NotebookConcatTextD ...@@ -40,14 +40,14 @@ export class ExtHostNotebookConcatDocument implements vscode.NotebookConcatTextD
this._cellLengths.changeValue(cellIdx, this._cells[cellIdx].document.getText().length + 1); this._cellLengths.changeValue(cellIdx, this._cells[cellIdx].document.getText().length + 1);
this._cellLines.changeValue(cellIdx, this._cells[cellIdx].document.lineCount); this._cellLines.changeValue(cellIdx, this._cells[cellIdx].document.lineCount);
this._versionId += 1; this._versionId += 1;
this._onDidChange.fire(this); this._onDidChange.fire(undefined);
} }
})); }));
this._disposables.add(extHostNotebooks.onDidChangeNotebookDocument(e => { this._disposables.add(extHostNotebooks.onDidChangeNotebookDocument(e => {
if (e.document === this._notebook) { if (e.document === this._notebook) {
this._init(); this._init();
this._versionId += 1; this._versionId += 1;
this._onDidChange.fire(this); this._onDidChange.fire(undefined);
} }
})); }));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册