find widget attempt

This commit is contained in:
rebornix
2020-02-25 15:17:38 -08:00
parent 298461ed02
commit cef3c06420
14 changed files with 382 additions and 60 deletions

View File

@@ -11,6 +11,7 @@ import { INotebookService, IMainNotebookController } from 'vs/workbench/contrib/
import { Emitter, Event } from 'vs/base/common/event';
import { ICell, IOutput, INotebook, INotebookMimeTypeSelector, NOTEBOOK_DISPLAY_ORDER, NotebookCellsSplice, NotebookCellOutputsSplice, generateCellPath } from 'vs/workbench/contrib/notebook/common/notebookCommon';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { PieceTreeTextBufferFactory, PieceTreeTextBufferBuilder } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder';
export class MainThreadCell implements ICell {
private _onDidChangeOutputs = new Emitter<NotebookCellOutputsSplice[]>();
@@ -38,6 +39,8 @@ export class MainThreadCell implements ICell {
readonly uri: URI;
private _buffer: PieceTreeTextBufferFactory | null = null;
constructor(
parent: MainThreadNotebookDocument,
public handle: number,
@@ -66,6 +69,17 @@ export class MainThreadCell implements ICell {
save() {
this._isDirty = false;
}
resolveTextBufferFactory(): PieceTreeTextBufferFactory {
if (this._buffer) {
return this._buffer;
}
let builder = new PieceTreeTextBufferBuilder();
builder.acceptChunk(this.source.join('\n'));
this._buffer = builder.finish(true);
return this._buffer;
}
}
export class MainThreadNotebookDocument extends Disposable implements INotebook {