File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
arduino-ide-extension/src/browser/widgets/sketchbook Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1- import { shell } from 'electron' ;
1+ import { remote } from 'electron' ;
22import { inject , injectable } from 'inversify' ;
33import { CommandRegistry } from '@theia/core/lib/common/command' ;
44import { MenuModelRegistry } from '@theia/core/lib/common/menu' ;
@@ -25,6 +25,7 @@ import {
2525} from '@theia/core/lib/common/disposable' ;
2626import { SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl' ;
2727import { FileService } from '@theia/filesystem/lib/browser/file-service' ;
28+ import { URI } from '../../contributions/contribution' ;
2829
2930export const SKETCHBOOK__CONTEXT = [ 'arduino-sketchbook--context' ] ;
3031
@@ -111,8 +112,16 @@ export class SketchbookWidgetContribution
111112 } ) ;
112113
113114 registry . registerCommand ( SketchbookCommands . REVEAL_IN_FINDER , {
114- execute : ( arg ) => {
115- shell . openPath ( arg . node . id ) ;
115+ execute : async ( arg ) => {
116+ if ( arg . node . uri ) {
117+ const exists = await this . fileService . exists ( new URI ( arg . node . uri ) ) ;
118+ if ( exists ) {
119+ const fsPath = await this . fileService . fsPath ( new URI ( arg . node . uri ) ) ;
120+ if ( fsPath ) {
121+ remote . shell . openPath ( fsPath ) ;
122+ }
123+ }
124+ }
116125 } ,
117126 isEnabled : ( arg ) =>
118127 ! ! arg && 'node' in arg && SketchbookTree . SketchDirNode . is ( arg . node ) ,
You can’t perform that action at this time.
0 commit comments