diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.ts index c819584f79726..c89954efb520d 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; +import { DisposableStore } from 'vs/base/common/lifecycle'; import { deepClone } from 'vs/base/common/objects'; import { IEditorOptions, LineNumbersType } from 'vs/editor/common/config/editorOptions'; import { localize } from 'vs/nls'; @@ -16,13 +16,13 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation import { Registry } from 'vs/platform/registry/common/platform'; import { ActiveEditorContext } from 'vs/workbench/common/editor'; import { INotebookCellToolbarActionContext, INotebookCommandContext, NotebookMultiCellAction, NOTEBOOK_ACTIONS_CATEGORY } from 'vs/workbench/contrib/notebook/browser/controller/coreActions'; -import { ICellViewModel, INotebookEditorDelegate, NOTEBOOK_CELL_LINE_NUMBERS, NOTEBOOK_EDITOR_FOCUSED } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; +import { CellViewModelStateChangeEvent, ICellViewModel, INotebookEditorDelegate, NOTEBOOK_CELL_LINE_NUMBERS, NOTEBOOK_EDITOR_FOCUSED } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; import { NotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookEditor'; +import { CellPart } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellPart'; import { NotebookCellInternalMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon'; import { NotebookOptions } from 'vs/workbench/contrib/notebook/common/notebookOptions'; -export class CellEditorOptions extends Disposable { - +export class CellEditorOptions extends CellPart { private static fixedEditorOptions: IEditorOptions = { scrollBeyondLastLine: false, scrollbar: { @@ -86,6 +86,19 @@ export class CellEditorOptions extends Disposable { this._value = this._computeEditorOptions(); } + prepareRender(): void { + // nothing to read + } + updateLayoutNow(element: ICellViewModel): void { + // nothing to update + } + + updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent) { + if (e.cellLineNumberChanged) { + this.setLineNumbers(element.lineNumbers); + } + } + private _recomputeOptions(): void { this._value = this._computeEditorOptions(); this._onDidChange.fire(); diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.ts index 11b345d5e9c6d..2b47bf53039a7 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.ts @@ -5,7 +5,7 @@ // import * as DOM from 'vs/base/browser/dom'; import { FastDomNode } from 'vs/base/browser/fastDomNode'; -import { ICellViewModel, INotebookEditorDelegate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; +import { CellViewModelStateChangeEvent, ICellViewModel, INotebookEditorDelegate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; import { CellPart } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellPart'; import { CodeCellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel'; import { CellKind } from 'vs/workbench/contrib/notebook/common/notebookCommon'; @@ -42,4 +42,8 @@ export class CellFocusIndicator extends CellPart { this.bottom.domNode.style.transform = `translateY(${cell.layoutInfo.totalHeight - bottomToolbarDimensions.bottomToolbarGap - layoutInfo.cellBottomMargin}px)`; } } + + updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void { + // nothing to update + } } diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.ts index e3cb7ece13283..ef404e39e93f0 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.ts @@ -24,7 +24,7 @@ import { ThemeIcon } from 'vs/platform/theme/common/themeService'; import { ViewContainerLocation } from 'vs/workbench/common/views'; import { IExtensionsViewPaneContainer, VIEWLET_ID as EXTENSION_VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions'; import { INotebookCellActionContext } from 'vs/workbench/contrib/notebook/browser/controller/coreActions'; -import { ICellOutputViewModel, ICellViewModel, IInsetRenderOutput, INotebookEditorDelegate, IRenderOutput, JUPYTER_EXTENSION_ID, RenderOutputType } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; +import { CellViewModelStateChangeEvent, ICellOutputViewModel, ICellViewModel, IInsetRenderOutput, INotebookEditorDelegate, IRenderOutput, JUPYTER_EXTENSION_ID, RenderOutputType } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; import { mimetypeIcon } from 'vs/workbench/contrib/notebook/browser/notebookIcons'; import { CodeCellRenderTemplate } from 'vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon'; import { getResizesObserver } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets'; @@ -602,6 +602,11 @@ export class CellOutputContainer extends CellPart { }); } + + updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void { + // nothing to update + } + render(editorHeight: number) { if (this.viewCell.outputsViewModels.length > 0) { if (this.viewCell.layoutInfo.totalHeight !== 0 && this.viewCell.layoutInfo.editorHeight > editorHeight) { diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellPart.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellPart.ts index 30cb897a804fd..61319b8bbb193 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellPart.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellPart.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Disposable } from 'vs/base/common/lifecycle'; -import { ICellViewModel } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; +import { CellViewModelStateChangeEvent, ICellViewModel } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; export abstract class CellPart extends Disposable { constructor() { @@ -20,4 +20,6 @@ export abstract class CellPart extends Disposable { * Update DOM based on layout info change of cell */ abstract updateLayoutNow(element: ICellViewModel): void; + + abstract updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void; } diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.ts index 00eac1b29e256..46394309daa06 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.ts @@ -5,7 +5,6 @@ import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar'; import { Disposable } from 'vs/base/common/lifecycle'; -import { CellViewModelStateChangeEvent } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; import { CodeCellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel'; import { NotebookCellExecutionState, NotebookCellInternalMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon'; @@ -34,18 +33,16 @@ export class CellProgressBar extends Disposable { } } - updateForCellState(e: CellViewModelStateChangeEvent, element: CodeCellViewModel): void { - if (e.inputCollapsedChanged) { - if (element.isInputCollapsed) { - this._progressBar.hide(); - if (element.internalMetadata.runState === NotebookCellExecutionState.Executing) { - showProgressBar(this._collapsedProgressBar); - } - } else { - this._collapsedProgressBar.hide(); - if (element.internalMetadata.runState === NotebookCellExecutionState.Executing) { - showProgressBar(this._progressBar); - } + updateForCellState(element: CodeCellViewModel): void { + if (element.isInputCollapsed) { + this._progressBar.hide(); + if (element.internalMetadata.runState === NotebookCellExecutionState.Executing) { + showProgressBar(this._collapsedProgressBar); + } + } else { + this._collapsedProgressBar.hide(); + if (element.internalMetadata.runState === NotebookCellExecutionState.Executing) { + showProgressBar(this._progressBar); } } } diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.ts index 7dedde54fae86..3c26ff165a8be 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.ts @@ -18,7 +18,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { INotebookCellActionContext } from 'vs/workbench/contrib/notebook/browser/controller/coreActions'; import { DeleteCellAction } from 'vs/workbench/contrib/notebook/browser/controller/editActions'; -import { ICellViewModel, INotebookEditorDelegate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; +import { CellViewModelStateChangeEvent, ICellViewModel, INotebookEditorDelegate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; import { CodiconActionViewItem } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView'; import { CellPart } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellPart'; @@ -77,6 +77,11 @@ export class BetweenCellToolbar extends CellPart { const bottomToolbarOffset = element.layoutInfo.bottomToolbarOffset; this._bottomCellToolbarContainer.style.transform = `translateY(${bottomToolbarOffset}px)`; } + + + updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void { + // nothing to update + } } diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.ts index 286dd48721e6c..26b22de0038ce 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.ts @@ -20,7 +20,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService, ThemeColor } from 'vs/platform/theme/common/themeService'; import { INotebookCellActionContext } from 'vs/workbench/contrib/notebook/browser/controller/coreActions'; -import { ICellViewModel } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; +import { CellViewModelStateChangeEvent, ICellViewModel } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; import { CellPart } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellPart'; import { CellStatusbarAlignment, INotebookCellStatusBarItem } from 'vs/workbench/contrib/notebook/common/notebookCommon'; @@ -112,6 +112,11 @@ export class CellEditorStatusBar extends CellPart { this.rightItems.forEach(item => item.maxWidth = maxItemWidth); } + + updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void { + // nothing to update + } + private getMaxItemWidth() { return this.width / 2; } diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts index 6cf3da89f65ab..197c98790f760 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts @@ -50,13 +50,52 @@ export class CodeCell extends Disposable { const editorHeight = this.calculateInitEditorHeight(); this.initializeEditor(editorHeight); - this.registerEditorOptionsListener(); - this.registerViewCellStateChange(); - this.registerFocusModeTracker(); - this.registerEditorLayoutListeners(); + + this.registerViewCellLayoutChange(); + this.registerCellEditorEventListeners(); this.registerDecorations(); this.registerMouseListener(); + this._register(this.viewCell.onDidChangeState(e => { + this.cellParts.forEach(cellPart => { + cellPart.updateState(this.viewCell, e); + }); + + if (e.outputIsHoveredChanged) { + this.updateForOutputHover(); + } + + if (e.inputCollapsedChanged) { + this.templateData.progressBar.updateForCellState(this.viewCell); + } + + if (e.outputIsFocusedChanged) { + this.updateForOutputFocus(); + } + + if (e.metadataChanged || e.internalMetadataChanged) { + this.updateEditorOptions(); + } + + if (e.inputCollapsedChanged || e.outputCollapsedChanged) { + this.viewCell.pauseLayout(); + const updated = this.updateForCollapseState(); + this.viewCell.resumeLayout(); + if (updated) { + this.relayoutCell(); + } + } + + if (e.focusModeChanged) { + this.updateEditorForFocusModeChange(); + } + })); + + this.updateEditorOptions(); + this.updateEditorForFocusModeChange(); + this.updateForOutputHover(); + this.updateForOutputFocus(); + // Render Outputs this._outputContainerRenderer = this.instantiationService.createInstance(CellOutputContainer, notebookEditor, viewCell, templateData, { limit: 500 }); this._outputContainerRenderer.render(editorHeight); @@ -72,6 +111,17 @@ export class CodeCell extends Disposable { })); this.updateForCollapseState(); + + this.updateForOutputs(); + this._register(viewCell.onDidChangeOutputs(_e => this.updateForOutputs())); + } + + private updateForOutputHover() { + this.templateData.container.classList.toggle('cell-output-hover', this.viewCell.outputIsHovered); + } + + private updateForOutputFocus() { + this.templateData.container.classList.toggle('cell-output-focus', this.viewCell.outputIsFocused); } private calculateInitEditorHeight() { @@ -124,41 +174,29 @@ export class CodeCell extends Disposable { }); } - private registerEditorOptionsListener() { - const updateEditorOptions = () => { - const editor = this.templateData.editor; - if (!editor) { - return; - } + private updateForOutputs(): void { + if (this.viewCell.outputsViewModels.length) { + DOM.show(this.templateData.focusSinkElement); + } else { + DOM.hide(this.templateData.focusSinkElement); + } + } - const isReadonly = this.notebookEditor.isReadOnly; - const padding = this.notebookEditor.notebookOptions.computeEditorPadding(this.viewCell.internalMetadata); - const options = editor.getOptions(); - if (options.get(EditorOption.readOnly) !== isReadonly || options.get(EditorOption.padding) !== padding) { - editor.updateOptions({ readOnly: this.notebookEditor.isReadOnly, padding: this.notebookEditor.notebookOptions.computeEditorPadding(this.viewCell.internalMetadata) }); - } - }; + private updateEditorOptions() { + const editor = this.templateData.editor; + if (!editor) { + return; + } - updateEditorOptions(); - this._register(this.viewCell.onDidChangeState((e) => { - if (e.metadataChanged || e.internalMetadataChanged) { - updateEditorOptions(); - } - })); + const isReadonly = this.notebookEditor.isReadOnly; + const padding = this.notebookEditor.notebookOptions.computeEditorPadding(this.viewCell.internalMetadata); + const options = editor.getOptions(); + if (options.get(EditorOption.readOnly) !== isReadonly || options.get(EditorOption.padding) !== padding) { + editor.updateOptions({ readOnly: this.notebookEditor.isReadOnly, padding: this.notebookEditor.notebookOptions.computeEditorPadding(this.viewCell.internalMetadata) }); + } } - private registerViewCellStateChange() { - this._register(this.viewCell.onDidChangeState((e) => { - if (e.inputCollapsedChanged || e.outputCollapsedChanged) { - this.viewCell.pauseLayout(); - const updated = this.updateForCollapseState(); - this.viewCell.resumeLayout(); - if (updated) { - this.relayoutCell(); - } - } - })); - + private registerViewCellLayoutChange() { this._register(this.viewCell.onDidChangeLayout((e) => { if (e.outerWidth !== undefined) { const layoutInfo = this.templateData.editor.getLayoutInfo(); @@ -173,7 +211,7 @@ export class CodeCell extends Disposable { })); } - private registerEditorLayoutListeners() { + private registerCellEditorEventListeners() { this._register(this.templateData.editor.onDidContentSizeChange((e) => { if (e.contentHeightChanged) { if (this.viewCell.layoutInfo.editorHeight !== e.contentHeight) { @@ -194,6 +232,28 @@ export class CodeCell extends Disposable { this.notebookEditor.revealLineInViewAsync(this.viewCell, primarySelection.positionLineNumber); } })); + + // Focus Mode + const updateFocusModeForEditorEvent = () => { + this.viewCell.focusMode = + (this.templateData.editor.hasWidgetFocus() || (document.activeElement && this.templateData.statusBar.statusBarContainer.contains(document.activeElement))) + ? CellFocusMode.Editor + : CellFocusMode.Container; + }; + + this._register(this.templateData.editor.onDidFocusEditorWidget(() => { + updateFocusModeForEditorEvent(); + })); + this._register(this.templateData.editor.onDidBlurEditorWidget(() => { + // this is for a special case: + // users click the status bar empty space, which we will then focus the editor + // so we don't want to update the focus state too eagerly, it will be updated with onDidFocusEditorWidget + if ( + this.notebookEditor.hasEditorFocus() && + !(document.activeElement && this.templateData.statusBar.statusBarContainer.contains(document.activeElement))) { + updateFocusModeForEditorEvent(); + } + })); } private registerDecorations() { @@ -252,43 +312,12 @@ export class CodeCell extends Disposable { })); } - private registerFocusModeTracker() { - const updateEditorForFocusModeChange = () => { - if (this.viewCell.focusMode === CellFocusMode.Editor && this.notebookEditor.getActiveCell() === this.viewCell) { - this.templateData.editor?.focus(); - } - - this.templateData.container.classList.toggle('cell-editor-focus', this.viewCell.focusMode === CellFocusMode.Editor); - }; - this._register(this.viewCell.onDidChangeState((e) => { - if (e.focusModeChanged) { - updateEditorForFocusModeChange(); - } - })); - - updateEditorForFocusModeChange(); - - // Focus Mode - const updateFocusModeForEditorEvent = () => { - this.viewCell.focusMode = - (this.templateData.editor.hasWidgetFocus() || (document.activeElement && this.templateData.statusBar.statusBarContainer.contains(document.activeElement))) - ? CellFocusMode.Editor - : CellFocusMode.Container; - }; + private updateEditorForFocusModeChange() { + if (this.viewCell.focusMode === CellFocusMode.Editor && this.notebookEditor.getActiveCell() === this.viewCell) { + this.templateData.editor?.focus(); + } - this._register(this.templateData.editor.onDidFocusEditorWidget(() => { - updateFocusModeForEditorEvent(); - })); - this._register(this.templateData.editor.onDidBlurEditorWidget(() => { - // this is for a special case: - // users click the status bar empty space, which we will then focus the editor - // so we don't want to update the focus state too eagerly, it will be updated with onDidFocusEditorWidget - if ( - this.notebookEditor.hasEditorFocus() && - !(document.activeElement && this.templateData.statusBar.statusBarContainer.contains(document.activeElement))) { - updateFocusModeForEditorEvent(); - } - })); + this.templateData.container.classList.toggle('cell-editor-focus', this.viewCell.focusMode === CellFocusMode.Editor); } private updateForCollapseState(): boolean { diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts index 3cc7ed86e4b03..aa770285fd814 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts @@ -591,14 +591,6 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende return combinedDisposable(dragHandleListener, collapsedPartListener, clickHandler); } - private updateForOutputs(element: CodeCellViewModel, templateData: CodeCellRenderTemplate): void { - if (element.outputsViewModels.length) { - DOM.show(templateData.focusSinkElement); - } else { - DOM.hide(templateData.focusSinkElement); - } - } - private updateForInternalMetadata(element: CodeCellViewModel, templateData: CodeCellRenderTemplate): void { if (!this.notebookEditor.hasModel()) { return; @@ -624,14 +616,6 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende } } - private updateForHover(element: CodeCellViewModel, templateData: CodeCellRenderTemplate): void { - templateData.container.classList.toggle('cell-output-hover', element.outputIsHovered); - } - - private updateForFocus(element: CodeCellViewModel, templateData: CodeCellRenderTemplate): void { - templateData.container.classList.toggle('cell-output-focus', element.outputIsFocused); - } - private updateForLayout(element: CodeCellViewModel, templateData: CodeCellRenderTemplate): void { templateData.elementDisposables.add(DOM.scheduleAtNextAnimationFrame(() => { const bottomToolbarDimensions = this.notebookEditor.notebookOptions.computeBottomToolbarDimensions(this.notebookEditor.textModel?.viewType); @@ -675,17 +659,19 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende templateData.outputContainer.domNode.appendChild(templateData.cellOutputCollapsedContainer); const elementDisposables = templateData.elementDisposables; + const cellEditorOptions = elementDisposables.add(new CellEditorOptions(this.notebookEditor, this.notebookEditor.notebookOptions, this.configurationService, element.language)); + elementDisposables.add(templateData.instantiationService.createInstance(CodeCell, this.notebookEditor, element, templateData, [ templateData.focusIndicator, templateData.betweenCellToolbar, - templateData.statusBar + templateData.statusBar, + cellEditorOptions ])); this.renderedEditors.set(element, templateData.editor); - const cellEditorOptions = new CellEditorOptions(this.notebookEditor, this.notebookEditor.notebookOptions, this.configurationService, element.language); - elementDisposables.add(cellEditorOptions); elementDisposables.add(cellEditorOptions.onDidChange(() => templateData.editor.updateOptions(cellEditorOptions.getUpdatedValue(element.internalMetadata)))); templateData.editor.updateOptions(cellEditorOptions.getUpdatedValue(element.internalMetadata)); + cellEditorOptions.setLineNumbers(element.lineNumbers); this.updateForLayout(element, templateData); elementDisposables.add(element.onDidChangeLayout(() => { @@ -693,33 +679,13 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende })); this.updateForInternalMetadata(element, templateData); - this.updateForHover(element, templateData); - this.updateForFocus(element, templateData); - cellEditorOptions.setLineNumbers(element.lineNumbers); elementDisposables.add(element.onDidChangeState((e) => { if (e.metadataChanged || e.internalMetadataChanged) { this.updateForInternalMetadata(element, templateData); this.updateForLayout(element, templateData); } - - if (e.outputIsHoveredChanged) { - this.updateForHover(element, templateData); - } - - if (e.outputIsFocusedChanged) { - this.updateForFocus(element, templateData); - } - - if (e.cellLineNumberChanged) { - cellEditorOptions.setLineNumbers(element.lineNumbers); - } - - templateData.progressBar.updateForCellState(e, element); })); - this.updateForOutputs(element, templateData); - elementDisposables.add(element.onDidChangeOutputs(_e => this.updateForOutputs(element, templateData))); - this.updateForKernel(element, templateData); const toolbarContext = {