mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-19 09:16:40 +00:00
Updated to Theia 1.4.0-next.a62011a5
.
- Aligned the daemon test to latest `js-yaml`. - Aligned the TS version with Theia. - Resolved a dependency-cycle with `next` Theia. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
ae6aec27db
commit
ecce237c6c
@ -38,6 +38,13 @@ export namespace ArduinoCommands {
|
||||
id: 'arduino-open-file'
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlike `OPEN_SKETCH`, it opens all files from a sketch folder. (ino, cpp, etc...)
|
||||
*/
|
||||
export const OPEN_SKETCH_FILES: Command = {
|
||||
id: 'arduino-open-sketch-files'
|
||||
}
|
||||
|
||||
export const SAVE_SKETCH: Command = {
|
||||
id: 'arduino-save-file'
|
||||
}
|
||||
|
@ -322,6 +322,12 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
|
||||
}
|
||||
});
|
||||
|
||||
registry.registerCommand(ArduinoCommands.OPEN_SKETCH_FILES, {
|
||||
execute: async (uri: string) => {
|
||||
this.openSketchFiles(uri);
|
||||
}
|
||||
});
|
||||
|
||||
registry.registerCommand(ArduinoCommands.SAVE_SKETCH, {
|
||||
isVisible: widget => ArduinoToolbar.is(widget) && widget.side === 'left',
|
||||
execute: (sketch: Sketch) => {
|
||||
@ -548,7 +554,7 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
|
||||
});
|
||||
}
|
||||
|
||||
async openSketchFiles(uri: string): Promise<void> {
|
||||
protected async openSketchFiles(uri: string): Promise<void> {
|
||||
const uris = await this.sketchService.getSketchFiles(uri);
|
||||
for (const uri of uris) {
|
||||
await this.editorManager.open(new URI(uri));
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { injectable, inject } from 'inversify';
|
||||
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 { ArduinoFrontendContribution } from '../arduino-frontend-contribution';
|
||||
import { ArduinoCommands } from '../arduino-commands';
|
||||
|
||||
@injectable()
|
||||
export class ArduinoFrontendApplication extends FrontendApplication {
|
||||
@ -14,8 +15,8 @@ export class ArduinoFrontendApplication extends FrontendApplication {
|
||||
@inject(WorkspaceService)
|
||||
protected readonly workspaceService: WorkspaceService;
|
||||
|
||||
@inject(ArduinoFrontendContribution)
|
||||
protected readonly frontendContribution: ArduinoFrontendContribution;
|
||||
@inject(CommandService)
|
||||
protected readonly commandService: CommandService;
|
||||
|
||||
@inject(EditorMode)
|
||||
protected readonly editorMode: EditorMode;
|
||||
@ -30,7 +31,7 @@ export class ArduinoFrontendApplication extends FrontendApplication {
|
||||
for (const root of roots) {
|
||||
const exists = await this.fileSystem.exists(root.uri);
|
||||
if (exists) {
|
||||
await this.frontendContribution.openSketchFiles(root.uri);
|
||||
await this.commandService.executeCommand(ArduinoCommands.OPEN_SKETCH_FILES.id, root.uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class SilentArduinoDaemonImpl extends ArduinoDaemonImpl {
|
||||
const destDir = track.mkdirSync();
|
||||
await spawnCommand(`"${cliPath}"`, ['config', 'init', '--dest-dir', destDir]);
|
||||
const content = fs.readFileSync(path.join(destDir, CLI_CONFIG), { encoding: 'utf8' });
|
||||
const cliConfig = safeLoad(content);
|
||||
const cliConfig = safeLoad(content) as any;
|
||||
cliConfig.daemon.port = String(this.port);
|
||||
const modifiedContent = safeDump(cliConfig);
|
||||
fs.writeFileSync(path.join(destDir, CLI_CONFIG), modifiedContent, { encoding: 'utf8' });
|
||||
|
@ -11,7 +11,7 @@
|
||||
"lerna": "^3.20.2",
|
||||
"rimraf": "^2.6.1",
|
||||
"tslint": "^5.5.0",
|
||||
"typescript": "3.5.1"
|
||||
"typescript": "^3.9.2"
|
||||
},
|
||||
"scripts": {
|
||||
"prepare": "lerna run prepare && yarn test && yarn download:plugins",
|
||||
|
Loading…
x
Reference in New Issue
Block a user