@@ -20,6 +20,7 @@ import {
20
20
FrontendApplication ,
21
21
FrontendApplicationContribution ,
22
22
LocalStorageService ,
23
+ SaveableWidget ,
23
24
StatusBar ,
24
25
StatusBarAlignment ,
25
26
} from '@theia/core/lib/browser' ;
@@ -70,6 +71,7 @@ import { SaveAsSketch } from './contributions/save-as-sketch';
70
71
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution' ;
71
72
import { IDEUpdaterDialog } from './dialogs/ide-updater/ide-updater-dialog' ;
72
73
import { IDEUpdater } from '../common/protocol/ide-updater' ;
74
+ import { FileSystemFrontendContribution } from '@theia/filesystem/lib/browser/filesystem-frontend-contribution' ;
73
75
74
76
const INIT_LIBS_AND_PACKAGES = 'initializedLibsAndPackages' ;
75
77
export const SKIP_IDE_VERSION = 'skipIDEVersion' ;
@@ -159,6 +161,9 @@ export class ArduinoFrontendContribution
159
161
@inject ( LocalStorageService )
160
162
protected readonly localStorageService : LocalStorageService ;
161
163
164
+ @inject ( FileSystemFrontendContribution )
165
+ protected readonly fileSystemFrontendContribution : FileSystemFrontendContribution ;
166
+
162
167
@inject ( IDEUpdater )
163
168
protected readonly updater : IDEUpdater ;
164
169
@@ -337,6 +342,17 @@ export class ArduinoFrontendContribution
337
342
} ) ;
338
343
339
344
app . shell . leftPanelHandler . removeBottomMenu ( 'settings-menu' ) ;
345
+
346
+ this . fileSystemFrontendContribution . onDidChangeEditorFile ( e => {
347
+ if ( e . type === FileChangeType . DELETED ) {
348
+ const editorWidget = e . editor ;
349
+ if ( SaveableWidget . is ( editorWidget ) ) {
350
+ editorWidget . closeWithoutSaving ( ) ;
351
+ } else {
352
+ editorWidget . close ( ) ;
353
+ }
354
+ }
355
+ } ) ;
340
356
}
341
357
342
358
onStop ( ) : void {
0 commit comments