mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-13 23:56:33 +00:00
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>
This commit is contained in:
parent
2bd9eef146
commit
f392ce752d
@ -3,7 +3,6 @@ import { FileSystem } from '@theia/filesystem/lib/common/filesystem';
|
|||||||
import { CommandService } from '@theia/core/lib/common/command';
|
import { CommandService } from '@theia/core/lib/common/command';
|
||||||
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
|
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
|
||||||
import { FrontendApplication } from '@theia/core/lib/browser/frontend-application';
|
import { FrontendApplication } from '@theia/core/lib/browser/frontend-application';
|
||||||
import { EditorMode } from '../editor-mode';
|
|
||||||
import { ArduinoCommands } from '../arduino-commands';
|
import { ArduinoCommands } from '../arduino-commands';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
@ -18,15 +17,8 @@ export class ArduinoFrontendApplication extends FrontendApplication {
|
|||||||
@inject(CommandService)
|
@inject(CommandService)
|
||||||
protected readonly commandService: CommandService;
|
protected readonly commandService: CommandService;
|
||||||
|
|
||||||
@inject(EditorMode)
|
|
||||||
protected readonly editorMode: EditorMode;
|
|
||||||
|
|
||||||
protected async initializeLayout(): Promise<void> {
|
protected async initializeLayout(): Promise<void> {
|
||||||
await super.initializeLayout();
|
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;
|
const roots = await this.workspaceService.roots;
|
||||||
for (const root of roots) {
|
for (const root of roots) {
|
||||||
const exists = await this.fileSystem.exists(root.uri);
|
const exists = await this.fileSystem.exists(root.uri);
|
||||||
@ -35,6 +27,5 @@ export class ArduinoFrontendApplication extends FrontendApplication {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user