File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
arduino-ide-extension/src/browser/contributions Expand file tree Collapse file tree 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' ;
22import * as remote from '@theia/core/electron-shared/@electron/remote' ;
33import * as dateFormat from 'dateformat' ;
44import { ArduinoMenus } from '../menu/arduino-menus' ;
@@ -11,9 +11,15 @@ import {
1111 KeybindingRegistry ,
1212} from './contribution' ;
1313import { nls } from '@theia/core/lib/common' ;
14+ import { ApplicationShell } from '@theia/core/lib/browser' ;
15+ import { timeout } from '@theia/core/lib/common/promise-util' ;
1416
1517@injectable ( )
1618export class SaveAsSketch extends SketchContribution {
19+
20+ @inject ( ApplicationShell )
21+ protected readonly applicationShell : ApplicationShell ;
22+
1723 registerCommands ( registry : CommandRegistry ) : void {
1824 registry . registerCommand ( SaveAsSketch . Commands . SAVE_AS_SKETCH , {
1925 execute : ( args ) => this . saveAs ( args ) ,
@@ -87,6 +93,8 @@ export class SaveAsSketch extends SketchContribution {
8793 if ( ! destinationUri ) {
8894 return false ;
8995 }
96+ await this . applicationShell . saveAll ( ) ;
97+ await timeout ( 20 ) ;
9098 const workspaceUri = await this . sketchService . copy ( sketch , {
9199 destinationUri,
92100 } ) ;
You can’t perform that action at this time.
0 commit comments