Skip to content

Commit f392ce7

Browse files
author
Akos Kitta
committed
Make sure the files from the sketch folder are opened at startup.
Previously, we opened the files only in classic mode. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
1 parent 2bd9eef commit f392ce7

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

arduino-ide-extension/src/browser/customization/arduino-frontend-application.ts

+5-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { FileSystem } from '@theia/filesystem/lib/common/filesystem';
33
import { CommandService } from '@theia/core/lib/common/command';
44
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
55
import { FrontendApplication } from '@theia/core/lib/browser/frontend-application';
6-
import { EditorMode } from '../editor-mode';
76
import { ArduinoCommands } from '../arduino-commands';
87

98
@injectable()
@@ -18,21 +17,13 @@ export class ArduinoFrontendApplication extends FrontendApplication {
1817
@inject(CommandService)
1918
protected readonly commandService: CommandService;
2019

21-
@inject(EditorMode)
22-
protected readonly editorMode: EditorMode;
23-
2420
protected async initializeLayout(): Promise<void> {
2521
await super.initializeLayout();
26-
// If not in PRO mode, we open the sketch file with all the related files.
27-
// Otherwise, we reuse the workbench's restore functionality and we do not open anything at all.
28-
// TODO: check `otherwise`. Also, what if we check for opened editors, instead of blindly opening them?
29-
if (!this.editorMode.proMode) {
30-
const roots = await this.workspaceService.roots;
31-
for (const root of roots) {
32-
const exists = await this.fileSystem.exists(root.uri);
33-
if (exists) {
34-
await this.commandService.executeCommand(ArduinoCommands.OPEN_SKETCH_FILES.id, root.uri);
35-
}
22+
const roots = await this.workspaceService.roots;
23+
for (const root of roots) {
24+
const exists = await this.fileSystem.exists(root.uri);
25+
if (exists) {
26+
await this.commandService.executeCommand(ArduinoCommands.OPEN_SKETCH_FILES.id, root.uri);
3627
}
3728
}
3829
}

0 commit comments

Comments
 (0)