diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts index 9a3c8d38140c0..09d6ffab3450f 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts @@ -85,6 +85,7 @@ import { EditorExtensionsRegistry } from 'vs/editor/browser/editorExtensions'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { NotebookPerfMarks } from 'vs/workbench/contrib/notebook/common/notebookPerformance'; import { BaseCellEditorOptions } from 'vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions'; +import { ILogService } from 'vs/platform/log/common/log'; const $ = DOM.$; @@ -255,6 +256,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD @INotebookExecutionService private readonly notebookExecutionService: INotebookExecutionService, @INotebookExecutionStateService notebookExecutionStateService: INotebookExecutionStateService, @IEditorProgressService private readonly editorProgressService: IEditorProgressService, + @ILogService private readonly logService: ILogService ) { super(); this.isEmbedded = creationOptions.isEmbedded ?? false; @@ -1481,12 +1483,15 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD private async _warmupWithMarkdownRenderer(viewModel: NotebookViewModel, viewState: INotebookEditorViewState | undefined) { + this.logService.trace('NotebookEditorWidget.warmup', this.viewModel?.uri.toString()); await this._resolveWebview(); + this.logService.trace('NotebookEditorWidget.warmup - webview resolved'); // make sure that the webview is not visible otherwise users will see pre-rendered markdown cells in wrong position as the list view doesn't have a correct `top` offset yet this._webview!.element.style.visibility = 'hidden'; // warm up can take around 200ms to load markdown libraries, etc. await this._warmupViewport(viewModel, viewState); + this.logService.trace('NotebookEditorWidget.warmup - viewport warmed up'); // todo@rebornix @mjbvz, is this too complicated? @@ -1505,7 +1510,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD this._list.scrollTop = viewState?.scrollPosition?.top ?? 0; this._debug('finish initial viewport warmup and view state restore.'); this._webview!.element.style.visibility = 'visible'; - + this.logService.trace('NotebookEditorWidget.warmup - list view model attached, set to visible'); } private async _warmupViewport(viewModel: NotebookViewModel, viewState: INotebookEditorViewState | undefined) {