From ca7e5e7485fa5104f93a7719a3d35e4ff7876e47 Mon Sep 17 00:00:00 2001 From: amunger Date: Fri, 13 Sep 2024 09:59:30 -0700 Subject: [PATCH 1/3] pass repl flag to exthost notebook, more API helpers --- .../mainThreadNotebookDocumentsAndEditors.ts | 3 ++- .../workbench/api/common/extHost.protocol.ts | 1 + .../workbench/api/common/extHostNotebook.ts | 11 ++++++--- .../api/common/extHostNotebookEditor.ts | 23 +++++++++---------- .../notebook/browser/notebookBrowser.ts | 1 + .../viewModel/notebookViewModelImpl.ts | 10 +++++--- .../vscode.proposed.notebookReplDocument.d.ts | 21 +++++++++++++---- 7 files changed, 47 insertions(+), 23 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts b/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts index 9e29b749351bf..1dfab2d7c8d1c 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts @@ -239,7 +239,8 @@ export class MainThreadNotebooksAndEditors { documentUri: add.textModel.uri, selections: add.getSelections(), visibleRanges: add.visibleRanges, - viewColumn: pane && editorGroupToColumn(this._editorGroupService, pane.group) + viewColumn: pane && editorGroupToColumn(this._editorGroupService, pane.group), + replView: add.getViewModel().replView }; } } diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 526e9666065c8..420d2632806b1 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -2575,6 +2575,7 @@ export interface INotebookEditorAddData { selections: ICellRange[]; visibleRanges: ICellRange[]; viewColumn?: number; + replView?: boolean; } export interface INotebookDocumentsAndEditorsDelta { diff --git a/src/vs/workbench/api/common/extHostNotebook.ts b/src/vs/workbench/api/common/extHostNotebook.ts index b6f9d2cf95f5d..b57fd65ab7633 100644 --- a/src/vs/workbench/api/common/extHostNotebook.ts +++ b/src/vs/workbench/api/common/extHostNotebook.ts @@ -211,7 +211,11 @@ export class ExtHostNotebookController implements ExtHostNotebookShape { preserveFocus: options.preserveFocus, selections: options.selections && options.selections.map(typeConverters.NotebookRange.from), pinned: typeof options.preview === 'boolean' ? !options.preview : undefined, - label: options?.label + label: options.asRepl === 'string' ? + options.asRepl : + typeof options.asRepl === 'object' ? + options.asRepl.label : + undefined, }; } else { resolvedOptions = { @@ -220,7 +224,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape { }; } - const viewType = options?.asRepl ? 'repl' : notebook.notebookType; + const viewType = !!options?.asRepl ? 'repl' : notebook.notebookType; const editorId = await this._notebookEditorsProxy.$tryShowNotebookDocument(notebook.uri, viewType, resolvedOptions); const editor = editorId && this._editors.get(editorId)?.apiEditor; @@ -588,7 +592,8 @@ export class ExtHostNotebookController implements ExtHostNotebookShape { document, data.visibleRanges.map(typeConverters.NotebookRange.to), data.selections.map(typeConverters.NotebookRange.to), - typeof data.viewColumn === 'number' ? typeConverters.ViewColumn.to(data.viewColumn) : undefined + typeof data.viewColumn === 'number' ? typeConverters.ViewColumn.to(data.viewColumn) : undefined, + data.replView ); this._editors.set(editorId, editor); diff --git a/src/vs/workbench/api/common/extHostNotebookEditor.ts b/src/vs/workbench/api/common/extHostNotebookEditor.ts index 47b4dce1f0c14..8848da871b9fc 100644 --- a/src/vs/workbench/api/common/extHostNotebookEditor.ts +++ b/src/vs/workbench/api/common/extHostNotebookEditor.ts @@ -14,10 +14,6 @@ export class ExtHostNotebookEditor { public static readonly apiEditorsToExtHost = new WeakMap(); - private _selections: vscode.NotebookRange[] = []; - private _visibleRanges: vscode.NotebookRange[] = []; - private _viewColumn?: vscode.ViewColumn; - private _visible: boolean = false; private _editor?: vscode.NotebookEditor; @@ -26,14 +22,11 @@ export class ExtHostNotebookEditor { readonly id: string, private readonly _proxy: MainThreadNotebookEditorsShape, readonly notebookData: ExtHostNotebookDocument, - visibleRanges: vscode.NotebookRange[], - selections: vscode.NotebookRange[], - viewColumn: vscode.ViewColumn | undefined - ) { - this._selections = selections; - this._visibleRanges = visibleRanges; - this._viewColumn = viewColumn; - } + private _visibleRanges: vscode.NotebookRange[], + private _selections: vscode.NotebookRange[], + private _viewColumn: vscode.ViewColumn | undefined, + private readonly _isRepl: boolean | undefined + ) { } get apiEditor(): vscode.NotebookEditor { if (!this._editor) { @@ -71,6 +64,12 @@ export class ExtHostNotebookEditor { get viewColumn() { return that._viewColumn; }, + get replOptions() { + if (!that._isRepl) { + return undefined; + } + return { appendIndex: this.notebook.cellCount - 1 }; + }, [Symbol.for('debug.description')]() { return `NotebookEditor(${this.notebook.uri.toString()})`; } diff --git a/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts b/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts index 1304dc78d0cb5..07b8040479df4 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts @@ -456,6 +456,7 @@ export interface INotebookViewModel { notebookDocument: NotebookTextModel; readonly viewCells: ICellViewModel[]; layoutInfo: NotebookLayoutInfo | null; + replView: boolean; onDidChangeViewCells: Event; onDidChangeSelection: Event; onDidFoldingStateChanged: Event; diff --git a/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts b/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts index 07a97175f09cd..6230b601e3f76 100644 --- a/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts +++ b/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts @@ -109,7 +109,7 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD private readonly _onDidChangeOptions = this._register(new Emitter()); get onDidChangeOptions(): Event { return this._onDidChangeOptions.event; } private _viewCells: CellViewModel[] = []; - private readonly replView: boolean; + private readonly _replView: boolean; get viewCells(): ICellViewModel[] { return this._viewCells; @@ -131,6 +131,10 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD return this._notebook.metadata; } + get replView() { + return this._replView; + } + private readonly _onDidChangeViewCells = this._register(new Emitter()); get onDidChangeViewCells(): Event { return this._onDidChangeViewCells.event; } @@ -204,7 +208,7 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD MODEL_ID++; this.id = '$notebookViewModel' + MODEL_ID; this._instanceId = strings.singleLetterHash(MODEL_ID); - this.replView = !!this.options.inRepl; + this._replView = !!this.options.inRepl; const compute = (changes: NotebookCellTextModelSplice[], synchronous: boolean) => { const diffs = changes.map(splice => { @@ -337,7 +341,7 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD })); - const viewCellCount = this.replView ? this._notebook.cells.length - 1 : this._notebook.cells.length; + const viewCellCount = this._replView ? this._notebook.cells.length - 1 : this._notebook.cells.length; for (let i = 0; i < viewCellCount; i++) { this._viewCells.push(createCellViewModel(this._instantiationService, this, this._notebook.cells[i], this._viewContext)); } diff --git a/src/vscode-dts/vscode.proposed.notebookReplDocument.d.ts b/src/vscode-dts/vscode.proposed.notebookReplDocument.d.ts index eefdb42cfc618..d78450e944a8d 100644 --- a/src/vscode-dts/vscode.proposed.notebookReplDocument.d.ts +++ b/src/vscode-dts/vscode.proposed.notebookReplDocument.d.ts @@ -8,13 +8,26 @@ declare module 'vscode' { export interface NotebookDocumentShowOptions { /** * The notebook should be opened in a REPL editor, - * where the last cell of the notebook is an input box and the rest are read-only. + * where the last cell of the notebook is an input box and the other cells are the read-only history. + * When the value is a string, it will be used as the label for the editor tab. */ - readonly asRepl?: boolean; + readonly asRepl?: boolean | string | { + /** + * The label to be used for the editor tab. + */ + readonly label: string; + }; + } + export interface NotebookEditor { /** - * The label to be used for the editor tab. + * Information about the REPL editor if the notebook was opened as a repl. */ - readonly label?: string; + replOptions?: { + /** + * The index where new cells should be appended. + */ + appendIndex: number; + }; } } From 744e8c31b2086189c63ebf10fff6daec416faffe Mon Sep 17 00:00:00 2001 From: amunger Date: Fri, 13 Sep 2024 10:55:43 -0700 Subject: [PATCH 2/3] fix parsing label --- src/vs/workbench/api/common/extHostNotebook.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/api/common/extHostNotebook.ts b/src/vs/workbench/api/common/extHostNotebook.ts index b57fd65ab7633..2162869d7efd1 100644 --- a/src/vs/workbench/api/common/extHostNotebook.ts +++ b/src/vs/workbench/api/common/extHostNotebook.ts @@ -211,7 +211,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape { preserveFocus: options.preserveFocus, selections: options.selections && options.selections.map(typeConverters.NotebookRange.from), pinned: typeof options.preview === 'boolean' ? !options.preview : undefined, - label: options.asRepl === 'string' ? + label: typeof options.asRepl === 'string' ? options.asRepl : typeof options.asRepl === 'object' ? options.asRepl.label : From 75aa433d31bbc8c435b9b24da8154f142d91fcba Mon Sep 17 00:00:00 2001 From: amunger Date: Fri, 13 Sep 2024 11:21:11 -0700 Subject: [PATCH 3/3] pass through viewtype instead of isRepl flag --- .../browser/mainThreadNotebookDocumentsAndEditors.ts | 2 +- src/vs/workbench/api/common/extHost.protocol.ts | 2 +- src/vs/workbench/api/common/extHostNotebook.ts | 2 +- src/vs/workbench/api/common/extHostNotebookEditor.ts | 8 ++++---- .../workbench/api/test/browser/extHostNotebook.test.ts | 6 ++++-- .../api/test/browser/extHostNotebookKernel.test.ts | 3 ++- .../contrib/notebook/browser/notebookBrowser.ts | 3 +-- .../contrib/notebook/browser/notebookEditorWidget.ts | 10 ++++------ .../browser/viewModel/notebookViewModelImpl.ts | 9 +++------ .../contrib/replNotebook/browser/replEditor.ts | 3 +-- 10 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts b/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts index 1dfab2d7c8d1c..89c8975eb7e48 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts @@ -240,7 +240,7 @@ export class MainThreadNotebooksAndEditors { selections: add.getSelections(), visibleRanges: add.visibleRanges, viewColumn: pane && editorGroupToColumn(this._editorGroupService, pane.group), - replView: add.getViewModel().replView + viewType: add.getViewModel().viewType }; } } diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 420d2632806b1..5025225ff840e 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -2575,7 +2575,7 @@ export interface INotebookEditorAddData { selections: ICellRange[]; visibleRanges: ICellRange[]; viewColumn?: number; - replView?: boolean; + viewType: string; } export interface INotebookDocumentsAndEditorsDelta { diff --git a/src/vs/workbench/api/common/extHostNotebook.ts b/src/vs/workbench/api/common/extHostNotebook.ts index 2162869d7efd1..75b6485722380 100644 --- a/src/vs/workbench/api/common/extHostNotebook.ts +++ b/src/vs/workbench/api/common/extHostNotebook.ts @@ -593,7 +593,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape { data.visibleRanges.map(typeConverters.NotebookRange.to), data.selections.map(typeConverters.NotebookRange.to), typeof data.viewColumn === 'number' ? typeConverters.ViewColumn.to(data.viewColumn) : undefined, - data.replView + data.viewType ); this._editors.set(editorId, editor); diff --git a/src/vs/workbench/api/common/extHostNotebookEditor.ts b/src/vs/workbench/api/common/extHostNotebookEditor.ts index 8848da871b9fc..c4c357d14c689 100644 --- a/src/vs/workbench/api/common/extHostNotebookEditor.ts +++ b/src/vs/workbench/api/common/extHostNotebookEditor.ts @@ -25,7 +25,7 @@ export class ExtHostNotebookEditor { private _visibleRanges: vscode.NotebookRange[], private _selections: vscode.NotebookRange[], private _viewColumn: vscode.ViewColumn | undefined, - private readonly _isRepl: boolean | undefined + private readonly viewType: string ) { } get apiEditor(): vscode.NotebookEditor { @@ -65,10 +65,10 @@ export class ExtHostNotebookEditor { return that._viewColumn; }, get replOptions() { - if (!that._isRepl) { - return undefined; + if (that.viewType === 'repl') { + return { appendIndex: this.notebook.cellCount - 1 }; } - return { appendIndex: this.notebook.cellCount - 1 }; + return undefined; }, [Symbol.for('debug.description')]() { return `NotebookEditor(${this.notebook.uri.toString()})`; diff --git a/src/vs/workbench/api/test/browser/extHostNotebook.test.ts b/src/vs/workbench/api/test/browser/extHostNotebook.test.ts index 1757a0408d929..54b14a349b4ad 100644 --- a/src/vs/workbench/api/test/browser/extHostNotebook.test.ts +++ b/src/vs/workbench/api/test/browser/extHostNotebook.test.ts @@ -97,7 +97,8 @@ suite('NotebookCell#Document', function () { documentUri: notebookUri, id: '_notebook_editor_0', selections: [{ start: 0, end: 1 }], - visibleRanges: [] + visibleRanges: [], + viewType: 'test' }] })); extHostNotebooks.$acceptDocumentAndEditorsDelta(new SerializableObjectWithBuffers({ newActiveEditor: '_notebook_editor_0' })); @@ -369,7 +370,8 @@ suite('NotebookCell#Document', function () { documentUri: notebookUri, id: '_notebook_editor_2', selections: [{ start: 0, end: 1 }], - visibleRanges: [] + visibleRanges: [], + viewType: 'test' }] })); diff --git a/src/vs/workbench/api/test/browser/extHostNotebookKernel.test.ts b/src/vs/workbench/api/test/browser/extHostNotebookKernel.test.ts index bc3d671f6f1bb..e025bb78bd0ec 100644 --- a/src/vs/workbench/api/test/browser/extHostNotebookKernel.test.ts +++ b/src/vs/workbench/api/test/browser/extHostNotebookKernel.test.ts @@ -136,7 +136,8 @@ suite('NotebookKernel', function () { documentUri: notebookUri, id: '_notebook_editor_0', selections: [{ start: 0, end: 1 }], - visibleRanges: [] + visibleRanges: [], + viewType: 'test', }] })); extHostNotebooks.$acceptDocumentAndEditorsDelta(new SerializableObjectWithBuffers({ newActiveEditor: '_notebook_editor_0' })); diff --git a/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts b/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts index 07b8040479df4..1c9bc699c8097 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts @@ -388,7 +388,6 @@ export interface INotebookEditorCreationOptions { }; readonly options?: NotebookOptions; readonly codeWindow?: CodeWindow; - readonly forRepl?: boolean; } export interface INotebookWebviewMessage { @@ -456,7 +455,7 @@ export interface INotebookViewModel { notebookDocument: NotebookTextModel; readonly viewCells: ICellViewModel[]; layoutInfo: NotebookLayoutInfo | null; - replView: boolean; + viewType: string; onDidChangeViewCells: Event; onDidChangeSelection: Event; onDidFoldingStateChanged: Event; diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts index b02721cd4776a..75ed726439e11 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts @@ -289,7 +289,6 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD readonly isEmbedded: boolean; private _readOnly: boolean; - private readonly _inRepl: boolean; public readonly scopedContextKeyService: IContextKeyService; private readonly instantiationService: IInstantiationService; @@ -327,7 +326,6 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD this.isEmbedded = creationOptions.isEmbedded ?? false; this._readOnly = creationOptions.isReadOnly ?? false; - this._inRepl = creationOptions.forRepl ?? false; this._overlayContainer = document.createElement('div'); this.scopedContextKeyService = this._register(contextKeyService.createScoped(this._overlayContainer)); @@ -1142,11 +1140,11 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD this.scopedContextKeyService.updateParent(parentContextKeyService); } - async setModel(textModel: NotebookTextModel, viewState: INotebookEditorViewState | undefined, perf?: NotebookPerfMarks): Promise { + async setModel(textModel: NotebookTextModel, viewState: INotebookEditorViewState | undefined, perf?: NotebookPerfMarks, viewType?: string): Promise { if (this.viewModel === undefined || !this.viewModel.equal(textModel)) { const oldBottomToolbarDimensions = this._notebookOptions.computeBottomToolbarDimensions(this.viewModel?.viewType); this._detachModel(); - await this._attachModel(textModel, viewState, perf); + await this._attachModel(textModel, viewType ?? textModel.viewType, viewState, perf); const newBottomToolbarDimensions = this._notebookOptions.computeBottomToolbarDimensions(this.viewModel?.viewType); if (oldBottomToolbarDimensions.bottomToolbarGap !== newBottomToolbarDimensions.bottomToolbarGap @@ -1452,10 +1450,10 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD this._list.attachWebview(this._webview.element); } - private async _attachModel(textModel: NotebookTextModel, viewState: INotebookEditorViewState | undefined, perf?: NotebookPerfMarks) { + private async _attachModel(textModel: NotebookTextModel, viewType: string, viewState: INotebookEditorViewState | undefined, perf?: NotebookPerfMarks) { this._ensureWebview(this.getId(), textModel.viewType, textModel.uri); - this.viewModel = this.instantiationService.createInstance(NotebookViewModel, textModel.viewType, textModel, this._viewContext, this.getLayoutInfo(), { isReadOnly: this._readOnly, inRepl: this._inRepl }); + this.viewModel = this.instantiationService.createInstance(NotebookViewModel, viewType, textModel, this._viewContext, this.getLayoutInfo(), { isReadOnly: this._readOnly }); this._viewContext.eventDispatcher.emit([new NotebookLayoutChangedEvent({ width: true, fontInfo: true }, this.getLayoutInfo())]); this.notebookOptions.updateOptions(this._readOnly); diff --git a/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts b/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts index 6230b601e3f76..ffcbcac3f79a9 100644 --- a/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts +++ b/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts @@ -99,7 +99,6 @@ let MODEL_ID = 0; export interface NotebookViewModelOptions { isReadOnly: boolean; - inRepl?: boolean; } export class NotebookViewModel extends Disposable implements EditorFoldingStateDelegate, INotebookViewModel { @@ -109,7 +108,6 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD private readonly _onDidChangeOptions = this._register(new Emitter()); get onDidChangeOptions(): Event { return this._onDidChangeOptions.event; } private _viewCells: CellViewModel[] = []; - private readonly _replView: boolean; get viewCells(): ICellViewModel[] { return this._viewCells; @@ -131,8 +129,8 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD return this._notebook.metadata; } - get replView() { - return this._replView; + private get isRepl() { + return this.viewType === 'repl'; } private readonly _onDidChangeViewCells = this._register(new Emitter()); @@ -208,7 +206,6 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD MODEL_ID++; this.id = '$notebookViewModel' + MODEL_ID; this._instanceId = strings.singleLetterHash(MODEL_ID); - this._replView = !!this.options.inRepl; const compute = (changes: NotebookCellTextModelSplice[], synchronous: boolean) => { const diffs = changes.map(splice => { @@ -341,7 +338,7 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD })); - const viewCellCount = this._replView ? this._notebook.cells.length - 1 : this._notebook.cells.length; + const viewCellCount = this.isRepl ? this._notebook.cells.length - 1 : this._notebook.cells.length; for (let i = 0; i < viewCellCount; i++) { this._viewCells.push(createCellViewModel(this._instantiationService, this, this._notebook.cells[i], this._viewContext)); } diff --git a/src/vs/workbench/contrib/replNotebook/browser/replEditor.ts b/src/vs/workbench/contrib/replNotebook/browser/replEditor.ts index d912227314da9..b574fe6337001 100644 --- a/src/vs/workbench/contrib/replNotebook/browser/replEditor.ts +++ b/src/vs/workbench/contrib/replNotebook/browser/replEditor.ts @@ -362,7 +362,6 @@ export class ReplEditor extends EditorPane implements IEditorPaneWithScrolling { this._notebookWidget = >this._instantiationService.invokeFunction(this._notebookWidgetService.retrieveWidget, this.group.id, input, { isEmbedded: true, isReadOnly: true, - forRepl: true, contributions: NotebookEditorExtensionsRegistry.getSomeEditorContributions([ ExecutionStateCellStatusBarContrib.id, TimerCellStatusBarContrib.id, @@ -431,7 +430,7 @@ export class ReplEditor extends EditorPane implements IEditorPaneWithScrolling { const viewState = options?.viewState ?? this._loadNotebookEditorViewState(input); await this._extensionService.whenInstalledExtensionsRegistered(); - await this._notebookWidget.value!.setModel(model.notebook, viewState?.notebook); + await this._notebookWidget.value!.setModel(model.notebook, viewState?.notebook, undefined, 'repl'); model.notebook.setCellCollapseDefault(this._notebookOptions.getCellCollapseDefault()); this._notebookWidget.value!.setOptions({ isReadOnly: true