diff --git a/arduino-ide-extension/src/browser/customization/arduino-frontend-application.ts b/arduino-ide-extension/src/browser/customization/arduino-frontend-application.ts index 23455c91..cb1ba47b 100644 --- a/arduino-ide-extension/src/browser/customization/arduino-frontend-application.ts +++ b/arduino-ide-extension/src/browser/customization/arduino-frontend-application.ts @@ -3,7 +3,6 @@ import { FileSystem } from '@theia/filesystem/lib/common/filesystem'; import { CommandService } from '@theia/core/lib/common/command'; import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service'; import { FrontendApplication } from '@theia/core/lib/browser/frontend-application'; -import { EditorMode } from '../editor-mode'; import { ArduinoCommands } from '../arduino-commands'; @injectable() @@ -18,21 +17,13 @@ export class ArduinoFrontendApplication extends FrontendApplication { @inject(CommandService) protected readonly commandService: CommandService; - @inject(EditorMode) - protected readonly editorMode: EditorMode; - protected async initializeLayout(): Promise { await super.initializeLayout(); - // If not in PRO mode, we open the sketch file with all the related files. - // Otherwise, we reuse the workbench's restore functionality and we do not open anything at all. - // TODO: check `otherwise`. Also, what if we check for opened editors, instead of blindly opening them? - if (!this.editorMode.proMode) { - const roots = await this.workspaceService.roots; - for (const root of roots) { - const exists = await this.fileSystem.exists(root.uri); - if (exists) { - await this.commandService.executeCommand(ArduinoCommands.OPEN_SKETCH_FILES.id, root.uri); - } + const roots = await this.workspaceService.roots; + for (const root of roots) { + const exists = await this.fileSystem.exists(root.uri); + if (exists) { + await this.commandService.executeCommand(ArduinoCommands.OPEN_SKETCH_FILES.id, root.uri); } } }