@@ -26,21 +26,21 @@ import { nls } from '@theia/core/lib/common';
26
26
@injectable ( )
27
27
export class OpenSketch extends SketchContribution {
28
28
@inject ( MenuModelRegistry )
29
- protected readonly menuRegistry : MenuModelRegistry ;
29
+ private readonly menuRegistry : MenuModelRegistry ;
30
30
31
31
@inject ( ContextMenuRenderer )
32
- protected readonly contextMenuRenderer : ContextMenuRenderer ;
32
+ private readonly contextMenuRenderer : ContextMenuRenderer ;
33
33
34
34
@inject ( BuiltInExamples )
35
- protected readonly builtInExamples : BuiltInExamples ;
35
+ private readonly builtInExamples : BuiltInExamples ;
36
36
37
37
@inject ( ExamplesService )
38
- protected readonly examplesService : ExamplesService ;
38
+ private readonly examplesService : ExamplesService ;
39
39
40
40
@inject ( Sketchbook )
41
- protected readonly sketchbook : Sketchbook ;
41
+ private readonly sketchbook : Sketchbook ;
42
42
43
- protected readonly toDispose = new DisposableCollection ( ) ;
43
+ private readonly toDispose = new DisposableCollection ( ) ;
44
44
45
45
override registerCommands ( registry : CommandRegistry ) : void {
46
46
registry . registerCommand ( OpenSketch . Commands . OPEN_SKETCH , {
@@ -130,7 +130,7 @@ export class OpenSketch extends SketchContribution {
130
130
} ) ;
131
131
}
132
132
133
- async openSketch (
133
+ private async openSketch (
134
134
toOpen : MaybePromise < Sketch | undefined > = this . selectSketch ( )
135
135
) : Promise < void > {
136
136
const sketch = await toOpen ;
@@ -139,21 +139,24 @@ export class OpenSketch extends SketchContribution {
139
139
}
140
140
}
141
141
142
- protected async selectSketch ( ) : Promise < Sketch | undefined > {
142
+ private async selectSketch ( ) : Promise < Sketch | undefined > {
143
143
const config = await this . configService . getConfiguration ( ) ;
144
144
const defaultPath = await this . fileService . fsPath (
145
145
new URI ( config . sketchDirUri )
146
146
) ;
147
- const { filePaths } = await remote . dialog . showOpenDialog ( {
148
- defaultPath,
149
- properties : [ 'createDirectory' , 'openFile' ] ,
150
- filters : [
151
- {
152
- name : nls . localize ( 'arduino/sketch/sketch' , 'Sketch' ) ,
153
- extensions : [ 'ino' , 'pde' ] ,
154
- } ,
155
- ] ,
156
- } ) ;
147
+ const { filePaths } = await remote . dialog . showOpenDialog (
148
+ remote . getCurrentWindow ( ) ,
149
+ {
150
+ defaultPath,
151
+ properties : [ 'createDirectory' , 'openFile' ] ,
152
+ filters : [
153
+ {
154
+ name : nls . localize ( 'arduino/sketch/sketch' , 'Sketch' ) ,
155
+ extensions : [ 'ino' , 'pde' ] ,
156
+ } ,
157
+ ] ,
158
+ }
159
+ ) ;
157
160
if ( ! filePaths . length ) {
158
161
return undefined ;
159
162
}
0 commit comments