Add Open file location as an option after an excel file is saved (#24331)

* Add Open file location as an option after an excel file is saved

* Fix test failure
This commit is contained in:
Sakshi Sharma
2023-09-07 15:19:39 -07:00
committed by GitHub
parent 863eb00294
commit b70f6ad7f2
2 changed files with 11 additions and 2 deletions

View File

@@ -77,7 +77,8 @@ suite('Data Resource Data Provider', function () {
contextService,
fileDialogService,
notificationService,
undefined // IOpenerService
undefined, // IOpenerService
undefined // ICommandService
);
instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Strict);
instantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(ResultSerializer)))

View File

@@ -20,6 +20,7 @@ import { IFileDialogService, FileFilter } from 'vs/platform/dialogs/common/dialo
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { IQueryEditorConfiguration } from 'sql/platform/query/common/query';
import { Schemas } from 'vs/base/common/network';
import { ICommandService } from 'vs/platform/commands/common/commands';
let prevSavePath: URI;
@@ -58,7 +59,8 @@ export class ResultSerializer {
@IWorkspaceContextService private _contextService: IWorkspaceContextService,
@IFileDialogService private readonly fileDialogService: IFileDialogService,
@INotificationService private _notificationService: INotificationService,
@IOpenerService private readonly openerService: IOpenerService
@IOpenerService private readonly openerService: IOpenerService,
@ICommandService private readonly commandService: ICommandService
) { }
/**
@@ -372,6 +374,12 @@ export class ResultSerializer {
run: () => {
this.openerService.open(filePath, { openExternal: format === SaveFormat.EXCEL });
}
},
{
label: nls.localize('openFileLocation', "Open file location"),
run: async () => {
this.commandService.executeCommand('revealFileInOS', filePath);
}
}]
);
}