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' ;
@@ -22,6 +22,7 @@ import {
2222} from '@theia/core/lib/common/disposable' ;
2323import { SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl' ;
2424import { FileService } from '@theia/filesystem/lib/browser/file-service' ;
25+ import { URI } from '../../contributions/contribution' ;
2526
2627export const SKETCHBOOK__CONTEXT = [ 'arduino-sketchbook--context' ] ;
2728
@@ -104,8 +105,16 @@ export class SketchbookWidgetContribution
104105 } ) ;
105106
106107 registry . registerCommand ( SketchbookCommands . REVEAL_IN_FINDER , {
107- execute : ( arg ) => {
108- shell . openPath ( arg . node . id ) ;
108+ execute : async ( arg ) => {
109+ if ( arg . node . uri ) {
110+ const exists = await this . fileService . exists ( new URI ( arg . node . uri ) ) ;
111+ if ( exists ) {
112+ const fsPath = await this . fileService . fsPath ( new URI ( arg . node . uri ) ) ;
113+ if ( fsPath ) {
114+ remote . shell . openPath ( fsPath ) ;
115+ }
116+ }
117+ }
109118 } ,
110119 isEnabled : ( arg ) =>
111120 ! ! arg && 'node' in arg && SketchbookTree . SketchDirNode . is ( arg . node ) ,
You can’t perform that action at this time.
0 commit comments