From 592801d74caee22fedc8a03c76b9016f7bd72266 Mon Sep 17 00:00:00 2001 From: Amir Omidi Date: Tue, 7 Apr 2020 11:12:51 -0700 Subject: [PATCH] Create a progress notification for saving files (#9875) * Create a progress notification for saving files * Remove unused import --- .../services/query/common/resultSerializer.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/sql/workbench/services/query/common/resultSerializer.ts b/src/sql/workbench/services/query/common/resultSerializer.ts index 85a83eae08..448f31c33e 100644 --- a/src/sql/workbench/services/query/common/resultSerializer.ts +++ b/src/sql/workbench/services/query/common/resultSerializer.ts @@ -12,7 +12,7 @@ import * as path from 'vs/base/common/path'; import * as nls from 'vs/nls'; import Severity from 'vs/base/common/severity'; -import { INotificationService } from 'vs/platform/notification/common/notification'; +import { INotificationService, INotification } from 'vs/platform/notification/common/notification'; import { getBaseLabel } from 'vs/base/common/labels'; import { ShowFileInFolderAction, OpenFileInFolderAction } from 'sql/workbench/common/workspaceActions'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -323,6 +323,15 @@ export class ResultSerializer { */ private async doSave(filePath: string, format: string, sendRequest: () => Promise): Promise { + const saveNotification: INotification = { + severity: Severity.Info, + message: nls.localize('savingFile', "Saving file..."), + progress: { + infinite: true + } + }; + const notificationHandle = this._notificationService.notify(saveNotification); + // send message to the sqlserverclient for converting results to the requested format and saving to filepath try { let result = await sendRequest(); @@ -343,6 +352,8 @@ export class ResultSerializer { severity: Severity.Error, message: msgSaveFailed + error }); + } finally { + notificationHandle.close(); } }