Merge from vscode 817eb6b0c720a4ecbc13c020afbbebfed667aa09 (#7356)

This commit is contained in:
Anthony Dresser
2019-09-24 21:36:17 -07:00
committed by GitHub
parent a29ae4d3b9
commit 6a6048d40f
541 changed files with 7045 additions and 7287 deletions

View File

@@ -4,28 +4,31 @@
*--------------------------------------------------------------------------------------------*/
import { Action } from 'vs/base/common/actions';
import { IWindowsService } from 'vs/platform/windows/common/windows';
import { IOpenerService } from 'vs/platform/opener/common/opener';
//tslint:disable-next-line:layering
import { ElectronMainService } from 'vs/platform/electron/electron-main/electronMainService';
//tslint:disable-next-line:layering
import { IElectronService } from 'vs/platform/electron/node/electron';
import { URI } from 'vs/base/common/uri';
export class ShowFileInFolderAction extends Action {
constructor(private path: string, label: string, private windowsService: ElectronMainService) {
constructor(private path: string, label: string, @IElectronService private windowsService: ElectronMainService) {
super('showItemInFolder.action.id', label);
}
run(): Promise<void> {
return this.windowsService.showItemInFolder(this.path);
return this.windowsService.showItemInFolder(undefined, this.path);
}
}
export class OpenFileInFolderAction extends Action {
constructor(private path: string, label: string, private windowsService: IWindowsService) {
constructor(private path: string, label: string, @IOpenerService private openerService: IOpenerService) {
super('showItemInFolder.action.id', label);
}
run() {
return this.windowsService.openExternal(this.path);
return this.openerService.open(URI.file(this.path));
}
}