@@ -21,22 +21,19 @@ export class ArduinoFrontendApplication extends FrontendApplication {
21
21
protected readonly editorMode : EditorMode ;
22
22
23
23
protected async initializeLayout ( ) : Promise < void > {
24
- return super . initializeLayout ( ) . then ( ( ) => {
25
- // If not in PRO mode, we open the sketch file with all the related files.
26
- // Otherwise, we reuse the workbench's restore functionality and we do not open anything at all.
27
- // TODO: check `otherwise`. Also, what if we check for opened editors, instead of blindly opening them?
28
- if ( ! this . editorMode . proMode ) {
29
- this . workspaceService . roots . then ( roots => {
30
- for ( const root of roots ) {
31
- this . fileSystem . exists ( root . uri ) . then ( exists => {
32
- if ( exists ) {
33
- this . frontendContribution . openSketchFiles ( root . uri ) ;
34
- }
35
- } ) ;
36
- }
37
- } ) ;
24
+ await super . initializeLayout ( ) ;
25
+ // If not in PRO mode, we open the sketch file with all the related files.
26
+ // Otherwise, we reuse the workbench's restore functionality and we do not open anything at all.
27
+ // TODO: check `otherwise`. Also, what if we check for opened editors, instead of blindly opening them?
28
+ if ( ! this . editorMode . proMode ) {
29
+ const roots = await this . workspaceService . roots ;
30
+ for ( const root of roots ) {
31
+ const exists = await this . fileSystem . exists ( root . uri ) ;
32
+ if ( exists ) {
33
+ await this . frontendContribution . openSketchFiles ( root . uri ) ;
34
+ }
38
35
}
39
- } ) ;
36
+ }
40
37
}
41
38
42
39
}
0 commit comments