asWebvewUri requires guid.
This commit is contained in:
parent
8e67cd2dc6
commit
23f5231511
4 changed files with 10 additions and 7 deletions
|
@ -377,6 +377,7 @@ export class MainThreadNotebookController implements IMainNotebookController {
|
|||
{ editType: CellEditType.Delete, count: mainthreadNotebook.textModel.cells.length, index: 0 },
|
||||
{ editType: CellEditType.Insert, index: 0, cells: data.cells }
|
||||
]);
|
||||
mainthreadNotebook.textModel.updateRenderers(data.renderers);
|
||||
}
|
||||
return mainthreadNotebook.textModel;
|
||||
}
|
||||
|
@ -397,6 +398,8 @@ export class MainThreadNotebookController implements IMainNotebookController {
|
|||
}
|
||||
]);
|
||||
|
||||
// TODO@rebornix load renderers after reloading
|
||||
|
||||
this._mainThreadNotebook.addNotebookDocument({
|
||||
viewType: document.viewType,
|
||||
handle: document.handle,
|
||||
|
@ -429,6 +432,7 @@ export class MainThreadNotebookController implements IMainNotebookController {
|
|||
|
||||
document.textModel.languages = data.languages;
|
||||
document.textModel.metadata = data.metadata;
|
||||
document.textModel.updateRenderers(data.renderers);
|
||||
|
||||
if (data.cells.length) {
|
||||
document.textModel.initialize(data!.cells);
|
||||
|
|
|
@ -891,9 +891,11 @@ export class ExtHostNotebookController implements ExtHostNotebookShape, ExtHostN
|
|||
source: cell.source,
|
||||
outputs: transformedOutputs
|
||||
};
|
||||
})
|
||||
}),
|
||||
renderers: [] as number[]
|
||||
};
|
||||
|
||||
dto.renderers = [...renderers];
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,9 +67,6 @@ export class NotebookEditorOptions extends EditorOptions {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
let EDITOR_ID = 0;
|
||||
|
||||
export class NotebookEditorWidget extends Disposable implements INotebookEditor {
|
||||
static readonly ID: string = 'workbench.editor.notebook';
|
||||
private static readonly EDITOR_MEMENTOS = new Map<string, EditorMemento<any>>();
|
||||
|
@ -95,7 +92,6 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
|
|||
private scrollBeyondLastLine: boolean;
|
||||
private readonly memento: Memento;
|
||||
private _isDisposed: boolean = false;
|
||||
private readonly _id: number;
|
||||
constructor(
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IStorageService storageService: IStorageService,
|
||||
|
@ -105,7 +101,6 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
|
|||
@ILayoutService private readonly _layoutService: ILayoutService
|
||||
) {
|
||||
super();
|
||||
this._id = (++EDITOR_ID);
|
||||
this.memento = new Memento(NotebookEditorWidget.ID, storageService);
|
||||
|
||||
this.outputRenderer = new OutputRenderer(this, this.instantiationService);
|
||||
|
@ -124,8 +119,9 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
|
|||
this.notebookService.addNotebookEditor(this);
|
||||
}
|
||||
|
||||
private _uuid = generateUuid();
|
||||
public getId(): string {
|
||||
return 'vs.editor.INotebookEditor:' + this._id;
|
||||
return this._uuid;
|
||||
}
|
||||
|
||||
private readonly _onDidChangeModel = new Emitter<NotebookTextModel | undefined>();
|
||||
|
|
|
@ -329,6 +329,7 @@ export interface NotebookDataDto {
|
|||
readonly cells: ICellDto2[];
|
||||
readonly languages: string[];
|
||||
readonly metadata: NotebookDocumentMetadata;
|
||||
readonly renderers: number[];
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue