mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
find widget attempt
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user