From da6e512e1333a3e96a8f9a217ae184fa7db759d4 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 7 Jun 2022 14:17:21 -0700 Subject: [PATCH] Fix Altair save button in the interactive window (#151389) Altair save as button doesn't work in the interactive window Fixes #150323 --- .../notebook/browser/view/renderers/backLayerWebView.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts index dedbe999773..e3e541e1d9f 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts @@ -37,7 +37,6 @@ import { preloadsScriptStr, RendererMetadata } from 'vs/workbench/contrib/notebo import { transformWebviewThemeVars } from 'vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping'; import { MarkupCellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel'; import { CellUri, INotebookRendererInfo, NotebookSetting, RendererMessagingSpec } from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { INotebookExecutionStateService } from 'vs/workbench/contrib/notebook/common/notebookExecutionStateService'; import { INotebookKernel } from 'vs/workbench/contrib/notebook/common/notebookKernelService'; import { IScopedRendererMessaging } from 'vs/workbench/contrib/notebook/common/notebookRendererMessagingService'; import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService'; @@ -136,7 +135,6 @@ export class BackLayerWebView extends Disposable { @ILanguageService private readonly languageService: ILanguageService, @IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService, @IEditorGroupsService private readonly editorGroupService: IEditorGroupsService, - @INotebookExecutionStateService notebookExecutionStateService: INotebookExecutionStateService ) { super(); @@ -859,7 +857,9 @@ var requirejs = (function() { return; } - const defaultDir = dirname(this.documentUri); + const defaultDir = this.documentUri.scheme === Schemas.vscodeInteractive ? + this.workspaceContextService.getWorkspace().folders[0]?.uri ?? await this.fileDialogService.defaultFilePath() : + dirname(this.documentUri); let defaultName: string; if (event.downloadName) { defaultName = event.downloadName;