Skip to content

Commit

Permalink
Create a progress notification for saving files (#9875)
Browse files Browse the repository at this point in the history
* Create a progress notification for saving files

* Remove unused import
  • Loading branch information
Amir Omidi authored Apr 7, 2020
1 parent 63006e6 commit 592801d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/sql/workbench/services/query/common/resultSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -323,6 +323,15 @@ export class ResultSerializer {
*/
private async doSave(filePath: string, format: string, sendRequest: () => Promise<SaveResultsResponse | undefined>): Promise<void> {

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();
Expand All @@ -343,6 +352,8 @@ export class ResultSerializer {
severity: Severity.Error,
message: msgSaveFailed + error
});
} finally {
notificationHandle.close();
}
}

Expand Down

0 comments on commit 592801d

Please sign in to comment.