File tree 1 file changed +9
-1
lines changed
arduino-ide-extension/src/browser/contributions
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
- import { injectable } from 'inversify' ;
1
+ import { inject , injectable } from 'inversify' ;
2
2
import * as remote from '@theia/core/electron-shared/@electron/remote' ;
3
3
import * as dateFormat from 'dateformat' ;
4
4
import { ArduinoMenus } from '../menu/arduino-menus' ;
@@ -11,9 +11,15 @@ import {
11
11
KeybindingRegistry ,
12
12
} from './contribution' ;
13
13
import { nls } from '@theia/core/lib/common' ;
14
+ import { ApplicationShell } from '@theia/core/lib/browser' ;
15
+ import { timeout } from '@theia/core/lib/common/promise-util' ;
14
16
15
17
@injectable ( )
16
18
export class SaveAsSketch extends SketchContribution {
19
+
20
+ @inject ( ApplicationShell )
21
+ protected readonly applicationShell : ApplicationShell ;
22
+
17
23
registerCommands ( registry : CommandRegistry ) : void {
18
24
registry . registerCommand ( SaveAsSketch . Commands . SAVE_AS_SKETCH , {
19
25
execute : ( args ) => this . saveAs ( args ) ,
@@ -87,6 +93,8 @@ export class SaveAsSketch extends SketchContribution {
87
93
if ( ! destinationUri ) {
88
94
return false ;
89
95
}
96
+ await this . applicationShell . saveAll ( ) ;
97
+ await timeout ( 20 ) ;
90
98
const workspaceUri = await this . sketchService . copy ( sketch , {
91
99
destinationUri,
92
100
} ) ;
You can’t perform that action at this time.
0 commit comments