Files
azuredatastudio/src/sql/workbench/common/workspaceActions.ts
Charles Gagnon 08f47e7e14 Fix "Open File Location" for CSV Export (#5273)
Fix #5177 - File path wasn't being parsed correctly, URI.file should be used for full file paths.
2019-04-30 10:41:19 -07:00

31 lines
1.0 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Action } from 'vs/base/common/actions';
import { IWindowsService } from 'vs/platform/windows/common/windows';
import { URI } from 'vs/base/common/uri';
export class ShowFileInFolderAction extends Action {
constructor(private path: string, label: string, private windowsService: IWindowsService) {
super('showItemInFolder.action.id', label);
}
run(): Promise<void> {
return this.windowsService.showItemInFolder(URI.file(this.path));
}
}
export class OpenFileInFolderAction extends Action {
constructor(private path: string, label: string, private windowsService: IWindowsService) {
super('showItemInFolder.action.id', label);
}
run() {
return this.windowsService.openExternal(this.path);
}
}