diff --git a/arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx b/arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx index d9e65fd48..c5332158d 100644 --- a/arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx +++ b/arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx @@ -70,6 +70,7 @@ import { SaveAsSketch } from './contributions/save-as-sketch'; import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution'; import { IDEUpdaterDialog } from './dialogs/ide-updater/ide-updater-dialog'; import { IDEUpdater } from '../common/protocol/ide-updater'; +import { FileSystemFrontendContribution } from '@theia/filesystem/lib/browser/filesystem-frontend-contribution'; const INIT_LIBS_AND_PACKAGES = 'initializedLibsAndPackages'; export const SKIP_IDE_VERSION = 'skipIDEVersion'; @@ -159,6 +160,9 @@ export class ArduinoFrontendContribution @inject(LocalStorageService) protected readonly localStorageService: LocalStorageService; + @inject(FileSystemFrontendContribution) + protected readonly fileSystemFrontendContribution: FileSystemFrontendContribution; + @inject(IDEUpdater) protected readonly updater: IDEUpdater; @@ -337,6 +341,12 @@ export class ArduinoFrontendContribution }); app.shell.leftPanelHandler.removeBottomMenu('settings-menu'); + + this.fileSystemFrontendContribution.onDidChangeEditorFile(e => { + if (e.type === FileChangeType.DELETED) { + e.editor.close(); + } + }); } onStop(): void {