this.commandIsToggled(id);
+ protected commandIsToggled(command: string): boolean {
+ return this.commands.isToggled(command, this);
+ }
protected render(): React.ReactNode {
return
}
diff --git a/arduino-ide-extension/src/browser/widgets/component-list/filterable-list-container.tsx b/arduino-ide-extension/src/browser/widgets/component-list/filterable-list-container.tsx
index ac20dda8e..35b943096 100644
--- a/arduino-ide-extension/src/browser/widgets/component-list/filterable-list-container.tsx
+++ b/arduino-ide-extension/src/browser/widgets/component-list/filterable-list-container.tsx
@@ -1,6 +1,9 @@
import * as React from 'react';
import debounce = require('lodash.debounce');
import { Event } from '@theia/core/lib/common/event';
+import { CommandService } from '@theia/core/lib/common/command';
+import { MessageService } from '@theia/core/lib/common/message-service';
+import { OutputCommands } from '@theia/output/lib/browser/output-commands';
import { ConfirmDialog } from '@theia/core/lib/browser/dialogs';
import { Searchable } from '../../../common/protocol/searchable';
import { Installable } from '../../../common/protocol/installable';
@@ -85,9 +88,13 @@ export class FilterableListContainer
extends React.C
const dialog = new InstallationProgressDialog(itemLabel(item), version);
try {
dialog.open();
+ await this.clearArduinoChannel();
await install({ item, version });
const items = await searchable.search({ query: this.state.filterText });
this.setState({ items: this.sort(items) });
+ } catch (error) {
+ this.props.messageService.error(error instanceof Error ? error.message : String(error));
+ throw error;
} finally {
dialog.close();
}
@@ -106,6 +113,7 @@ export class FilterableListContainer extends React.C
const { uninstall, searchable, itemLabel } = this.props;
const dialog = new UninstallationProgressDialog(itemLabel(item));
try {
+ await this.clearArduinoChannel();
dialog.open();
await uninstall({ item });
const items = await searchable.search({ query: this.state.filterText });
@@ -115,6 +123,10 @@ export class FilterableListContainer extends React.C
}
}
+ private async clearArduinoChannel(): Promise {
+ return this.props.commandService.executeCommand(OutputCommands.CLEAR.id, { name: 'Arduino' });
+ }
+
}
export namespace FilterableListContainer {
@@ -129,6 +141,8 @@ export namespace FilterableListContainer {
readonly filterTextChangeEvent: Event;
readonly install: ({ item, version }: { item: T, version: Installable.Version }) => Promise;
readonly uninstall: ({ item }: { item: T }) => Promise;
+ readonly messageService: MessageService;
+ readonly commandService: CommandService;
}
export interface State {
diff --git a/arduino-ide-extension/src/browser/widgets/component-list/list-widget.tsx b/arduino-ide-extension/src/browser/widgets/component-list/list-widget.tsx
index 4311f1d46..1c4baabe9 100644
--- a/arduino-ide-extension/src/browser/widgets/component-list/list-widget.tsx
+++ b/arduino-ide-extension/src/browser/widgets/component-list/list-widget.tsx
@@ -5,6 +5,8 @@ import { Deferred } from '@theia/core/lib/common/promise-util';
import { Emitter } from '@theia/core/lib/common/event';
import { MaybePromise } from '@theia/core/lib/common/types';
import { ReactWidget } from '@theia/core/lib/browser/widgets/react-widget';
+import { CommandService } from '@theia/core/lib/common/command';
+import { MessageService } from '@theia/core/lib/common/message-service';
import { Installable } from '../../../common/protocol/installable';
import { Searchable } from '../../../common/protocol/searchable';
import { ArduinoComponent } from '../../../common/protocol/arduino-component';
@@ -15,6 +17,12 @@ import { NotificationCenter } from '../../notification-center';
@injectable()
export abstract class ListWidget extends ReactWidget {
+ @inject(MessageService)
+ protected readonly messageService: MessageService;
+
+ @inject(CommandService)
+ protected readonly commandService: CommandService;
+
@inject(NotificationCenter)
protected readonly notificationCenter: NotificationCenter;
@@ -87,7 +95,9 @@ export abstract class ListWidget extends ReactWidget
uninstall={this.uninstall.bind(this)}
itemLabel={this.options.itemLabel}
itemRenderer={this.options.itemRenderer}
- filterTextChangeEvent={this.filterTextChangeEmitter.event} />;
+ filterTextChangeEvent={this.filterTextChangeEmitter.event}
+ messageService={this.messageService}
+ commandService={this.commandService} />;
}
/**
diff --git a/arduino-ide-extension/src/common/protocol/boards-service.ts b/arduino-ide-extension/src/common/protocol/boards-service.ts
index 218b588b2..8e61217af 100644
--- a/arduino-ide-extension/src/common/protocol/boards-service.ts
+++ b/arduino-ide-extension/src/common/protocol/boards-service.ts
@@ -121,9 +121,7 @@ export interface BoardsService extends Installable, Searchable;
getBoardPackage(options: { id: string }): Promise;
getContainerBoardPackage(options: { fqbn: string }): Promise;
- // The CLI cannot do fuzzy search. This method provides all boards and we do the fuzzy search (with monaco) on the frontend.
- // https://github.com/arduino/arduino-cli/issues/629
- allBoards(options: {}): Promise>;
+ searchBoards({ query }: { query?: string }): Promise;
}
export interface Port {
diff --git a/arduino-ide-extension/src/common/protocol/examples-service.ts b/arduino-ide-extension/src/common/protocol/examples-service.ts
index 783af370f..2d511c0f2 100644
--- a/arduino-ide-extension/src/common/protocol/examples-service.ts
+++ b/arduino-ide-extension/src/common/protocol/examples-service.ts
@@ -1,14 +1,10 @@
-import { Sketch } from './sketches-service';
+import { SketchContainer } from './sketches-service';
export const ExamplesServicePath = '/services/example-service';
export const ExamplesService = Symbol('ExamplesService');
export interface ExamplesService {
- builtIns(): Promise;
- installed(options: { fqbn: string }): Promise<{ user: ExampleContainer[], current: ExampleContainer[], any: ExampleContainer[] }>;
+ builtIns(): Promise;
+ installed(options: { fqbn: string }): Promise<{ user: SketchContainer[], current: SketchContainer[], any: SketchContainer[] }>;
}
-export interface ExampleContainer {
- readonly label: string;
- readonly children: ExampleContainer[];
- readonly sketches: Sketch[];
-}
+
diff --git a/arduino-ide-extension/src/common/protocol/library-service.ts b/arduino-ide-extension/src/common/protocol/library-service.ts
index aaf5444fa..7369e84f9 100644
--- a/arduino-ide-extension/src/common/protocol/library-service.ts
+++ b/arduino-ide-extension/src/common/protocol/library-service.ts
@@ -10,7 +10,7 @@ export interface LibraryService extends Installable, Searchable<
* When `installDependencies` is not set, it is `true` by default. If you want to skip the installation of required dependencies, set it to `false`.
*/
install(options: { item: LibraryPackage, version?: Installable.Version, installDependencies?: boolean }): Promise;
- installZip(options: { zipUri: string }): Promise;
+ installZip(options: { zipUri: string, overwrite?: boolean }): Promise;
/**
* Set `filterSelf` to `true` if you want to avoid having `item` in the result set.
* Note: as of today (22.02.2021), the CLI works like this: `./arduino-cli lib deps Adaino@0.1.0 ✕ Adaino 0.1.0 must be installed.`.
diff --git a/arduino-ide-extension/src/common/protocol/sketches-service-client-impl.ts b/arduino-ide-extension/src/common/protocol/sketches-service-client-impl.ts
index 3ad64af3b..dba9a497d 100644
--- a/arduino-ide-extension/src/common/protocol/sketches-service-client-impl.ts
+++ b/arduino-ide-extension/src/common/protocol/sketches-service-client-impl.ts
@@ -9,6 +9,7 @@ import { FrontendApplicationContribution } from '@theia/core/lib/browser';
import { ConfigService } from './config-service';
import { DisposableCollection, Emitter } from '@theia/core';
import { FileChangeType } from '@theia/filesystem/lib/browser';
+import { SketchContainer } from './sketches-service';
@injectable()
export class SketchesServiceClientImpl implements FrontendApplicationContribution {
@@ -35,9 +36,9 @@ export class SketchesServiceClientImpl implements FrontendApplicationContributio
onStart(): void {
this.configService.getConfiguration().then(({ sketchDirUri }) => {
- this.sketchService.getSketches(sketchDirUri).then(sketches => {
+ this.sketchService.getSketches({ uri: sketchDirUri }).then(container => {
const sketchbookUri = new URI(sketchDirUri);
- for (const sketch of sketches) {
+ for (const sketch of SketchContainer.toArray(container)) {
this.sketches.set(sketch.uri, sketch);
}
this.toDispose.push(this.fileService.watch(new URI(sketchDirUri), { recursive: true, excludes: [] }));
diff --git a/arduino-ide-extension/src/common/protocol/sketches-service.ts b/arduino-ide-extension/src/common/protocol/sketches-service.ts
index cf619800a..f521a205f 100644
--- a/arduino-ide-extension/src/common/protocol/sketches-service.ts
+++ b/arduino-ide-extension/src/common/protocol/sketches-service.ts
@@ -5,10 +5,11 @@ export const SketchesService = Symbol('SketchesService');
export interface SketchesService {
/**
- * Returns with the direct sketch folders from the location of the `fileStat`.
- * The sketches returns with inverse-chronological order, the first item is the most recent one.
+ * Resolves to a sketch container representing the hierarchical structure of the sketches.
+ * If `uri` is not given, `directories.user` will be user instead. Specify `exclude` global patterns to filter folders from the sketch container.
+ * If `exclude` is not set `['**\/libraries\/**', '**\/hardware\/**']` will be used instead.
*/
- getSketches(uri?: string): Promise;
+ getSketches({ uri, exclude }: { uri?: string, exclude?: string[] }): Promise;
/**
* This is the TS implementation of `SketchLoad` from the CLI and should be replaced with a gRPC call eventually.
@@ -63,6 +64,12 @@ export interface SketchesService {
*/
archive(sketch: Sketch, destinationUri: string): Promise;
+ /**
+ * Counterpart of the CLI's `genBuildPath` functionality.
+ * Based on https://github.com/arduino/arduino-cli/blob/550179eefd2d2bca299d50a4af9e9bfcfebec649/arduino/builder/builder.go#L30-L38
+ */
+ getIdeTempFolderUri(sketch: Sketch): Promise;
+
}
export interface Sketch {
@@ -94,3 +101,51 @@ export namespace Sketch {
return Extensions.MAIN.some(ext => arg.endsWith(ext));
}
}
+
+export interface SketchContainer {
+ readonly label: string;
+ readonly children: SketchContainer[];
+ readonly sketches: Sketch[];
+}
+export namespace SketchContainer {
+
+ export function is(arg: any): arg is SketchContainer {
+ return !!arg
+ && 'label' in arg && typeof arg.label === 'string'
+ && 'children' in arg && Array.isArray(arg.children)
+ && 'sketches' in arg && Array.isArray(arg.sketches);
+ }
+
+ /**
+ * `false` if the `container` recursively contains at least one sketch. Otherwise, `true`.
+ */
+ export function isEmpty(container: SketchContainer): boolean {
+ const hasSketch = (parent: SketchContainer) => {
+ if (parent.sketches.length || parent.children.some(child => hasSketch(child))) {
+ return true;
+ }
+ return false;
+ }
+ return !hasSketch(container);
+ }
+
+ export function prune(container: T): T {
+ for (let i = container.children.length - 1; i >= 0; i--) {
+ if (isEmpty(container.children[i])) {
+ container.children.splice(i, 1);
+ }
+ }
+ return container;
+ }
+
+ export function toArray(container: SketchContainer): Sketch[] {
+ const visit = (parent: SketchContainer, toPushSketch: Sketch[]) => {
+ toPushSketch.push(...parent.sketches);
+ parent.children.map(child => visit(child, toPushSketch));
+ }
+ const sketches: Sketch[] = [];
+ visit(container, sketches);
+ return sketches;
+ }
+
+}
diff --git a/arduino-ide-extension/src/electron-main/splash/splash-screen.ts b/arduino-ide-extension/src/electron-main/splash/splash-screen.ts
index 6f395acf1..1c24dd28e 100644
--- a/arduino-ide-extension/src/electron-main/splash/splash-screen.ts
+++ b/arduino-ide-extension/src/electron-main/splash/splash-screen.ts
@@ -28,7 +28,7 @@ SOFTWARE.
*/
import { Event } from '@theia/core/lib/common/event';
-import { BrowserWindow } from "electron";
+import { BrowserWindow } from 'electron';
/**
* When splashscreen was shown.
@@ -126,11 +126,11 @@ export const initSplashScreen = (config: Config, onCloseRequested?: Event)
const window = new BrowserWindow(xConfig.windowOpts);
splashScreen = new BrowserWindow(xConfig.splashScreenOpts);
splashScreen.loadURL(`file://${xConfig.templateUrl}`);
- xConfig.closeWindow && splashScreen.on("close", () => {
+ xConfig.closeWindow && splashScreen.on('close', () => {
done || window.close();
});
// Splashscreen is fully loaded and ready to view.
- splashScreen.webContents.on("did-finish-load", () => {
+ splashScreen.webContents.on('did-finish-load', () => {
splashScreenReady = true;
showSplash();
});
diff --git a/arduino-ide-extension/src/node/boards-service-impl.ts b/arduino-ide-extension/src/node/boards-service-impl.ts
index a354a4878..87a546cf2 100644
--- a/arduino-ide-extension/src/node/boards-service-impl.ts
+++ b/arduino-ide-extension/src/node/boards-service-impl.ts
@@ -8,11 +8,12 @@ import {
} from '../common/protocol';
import {
PlatformSearchReq, PlatformSearchResp, PlatformInstallReq, PlatformInstallResp, PlatformListReq,
- PlatformListResp, Platform, PlatformUninstallResp, PlatformUninstallReq
+ PlatformListResp, PlatformUninstallResp, PlatformUninstallReq
} from './cli-protocol/commands/core_pb';
+import { Platform } from './cli-protocol/commands/common_pb';
import { BoardDiscovery } from './board-discovery';
import { CoreClientAware } from './core-client-provider';
-import { BoardDetailsReq, BoardDetailsResp } from './cli-protocol/commands/board_pb';
+import { BoardDetailsReq, BoardDetailsResp, BoardSearchReq } from './cli-protocol/commands/board_pb';
import { ListProgrammersAvailableForUploadReq, ListProgrammersAvailableForUploadResp } from './cli-protocol/commands/upload_pb';
@injectable()
@@ -144,10 +145,33 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService
return packages.find(({ boards }) => boards.some(({ fqbn }) => fqbn === expectedFqbn));
}
- async allBoards(options: {}): Promise> {
- const results = await this.search(options);
- return results.map(item => item.boards.map(board => ({ ...board, packageName: item.name, packageId: item.id })))
- .reduce((acc, curr) => acc.concat(curr), []);
+ async searchBoards({ query }: { query?: string }): Promise {
+ const { instance, client } = await this.coreClient();
+ const req = new BoardSearchReq();
+ req.setSearchArgs(query || '');
+ req.setInstance(instance);
+ const boards = await new Promise((resolve, reject) => {
+ client.boardSearch(req, (error, resp) => {
+ if (error) {
+ reject(error);
+ return;
+ }
+ const boards: Array = [];
+ for (const board of resp.getBoardsList()) {
+ const platform = board.getPlatform();
+ if (platform) {
+ boards.push({
+ name: board.getName(),
+ fqbn: board.getFqbn(),
+ packageId: platform.getId(),
+ packageName: platform.getName()
+ });
+ }
+ }
+ resolve(boards);
+ })
+ });
+ return boards;
}
async search(options: { query?: string }): Promise {
@@ -254,7 +278,11 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService
});
await new Promise((resolve, reject) => {
resp.on('end', resolve);
- resp.on('error', reject);
+ resp.on('error', error => {
+ this.outputService.append({ chunk: `Failed to install platform: ${item.id}.\n` });
+ this.outputService.append({ chunk: error.toString() });
+ reject(error);
+ });
});
const items = await this.search({});
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.d.ts
index 7674f7545..73791ecce 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.d.ts
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.d.ts
@@ -92,6 +92,9 @@ export class BoardDetailsResp extends jspb.Message {
getDebuggingSupported(): boolean;
setDebuggingSupported(value: boolean): BoardDetailsResp;
+ getSerialnumber(): string;
+ setSerialnumber(value: string): BoardDetailsResp;
+
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): BoardDetailsResp.AsObject;
@@ -119,6 +122,7 @@ export namespace BoardDetailsResp {
identificationPrefList: Array,
programmersList: Array,
debuggingSupported: boolean,
+ serialnumber: string,
}
}
@@ -535,6 +539,9 @@ export class DetectedPort extends jspb.Message {
setBoardsList(value: Array): DetectedPort;
addBoards(value?: BoardListItem, index?: number): BoardListItem;
+ getSerialNumber(): string;
+ setSerialNumber(value: string): DetectedPort;
+
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DetectedPort.AsObject;
@@ -552,6 +559,7 @@ export namespace DetectedPort {
protocol: string,
protocolLabel: string,
boardsList: Array,
+ serialNumber: string,
}
}
@@ -689,6 +697,12 @@ export class BoardListItem extends jspb.Message {
setPid(value: string): BoardListItem;
+ hasPlatform(): boolean;
+ clearPlatform(): void;
+ getPlatform(): commands_common_pb.Platform | undefined;
+ setPlatform(value?: commands_common_pb.Platform): BoardListItem;
+
+
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): BoardListItem.AsObject;
static toObject(includeInstance: boolean, msg: BoardListItem): BoardListItem.AsObject;
@@ -706,5 +720,61 @@ export namespace BoardListItem {
isHidden: boolean,
vid: string,
pid: string,
+ platform?: commands_common_pb.Platform.AsObject,
+ }
+}
+
+export class BoardSearchReq extends jspb.Message {
+
+ hasInstance(): boolean;
+ clearInstance(): void;
+ getInstance(): commands_common_pb.Instance | undefined;
+ setInstance(value?: commands_common_pb.Instance): BoardSearchReq;
+
+ getSearchArgs(): string;
+ setSearchArgs(value: string): BoardSearchReq;
+
+ getIncludeHiddenBoards(): boolean;
+ setIncludeHiddenBoards(value: boolean): BoardSearchReq;
+
+
+ serializeBinary(): Uint8Array;
+ toObject(includeInstance?: boolean): BoardSearchReq.AsObject;
+ static toObject(includeInstance: boolean, msg: BoardSearchReq): BoardSearchReq.AsObject;
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo};
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo};
+ static serializeBinaryToWriter(message: BoardSearchReq, writer: jspb.BinaryWriter): void;
+ static deserializeBinary(bytes: Uint8Array): BoardSearchReq;
+ static deserializeBinaryFromReader(message: BoardSearchReq, reader: jspb.BinaryReader): BoardSearchReq;
+}
+
+export namespace BoardSearchReq {
+ export type AsObject = {
+ instance?: commands_common_pb.Instance.AsObject,
+ searchArgs: string,
+ includeHiddenBoards: boolean,
+ }
+}
+
+export class BoardSearchResp extends jspb.Message {
+ clearBoardsList(): void;
+ getBoardsList(): Array;
+ setBoardsList(value: Array): BoardSearchResp;
+ addBoards(value?: BoardListItem, index?: number): BoardListItem;
+
+
+ serializeBinary(): Uint8Array;
+ toObject(includeInstance?: boolean): BoardSearchResp.AsObject;
+ static toObject(includeInstance: boolean, msg: BoardSearchResp): BoardSearchResp.AsObject;
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo};
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo};
+ static serializeBinaryToWriter(message: BoardSearchResp, writer: jspb.BinaryWriter): void;
+ static deserializeBinary(bytes: Uint8Array): BoardSearchResp;
+ static deserializeBinaryFromReader(message: BoardSearchResp, reader: jspb.BinaryReader): BoardSearchResp;
+}
+
+export namespace BoardSearchResp {
+ export type AsObject = {
+ boardsList: Array,
}
}
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.js
index 628aeba3d..b2f1271be 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.js
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/board_pb.js
@@ -28,6 +28,8 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.BoardListResp', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.BoardListWatchReq', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.BoardListWatchResp', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.BoardPlatform', null, global);
+goog.exportSymbol('proto.cc.arduino.cli.commands.BoardSearchReq', null, global);
+goog.exportSymbol('proto.cc.arduino.cli.commands.BoardSearchResp', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.ConfigOption', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.ConfigValue', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.DetectedPort', null, global);
@@ -478,6 +480,48 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.cc.arduino.cli.commands.BoardListItem.displayName = 'proto.cc.arduino.cli.commands.BoardListItem';
}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq = function(opt_data) {
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.cc.arduino.cli.commands.BoardSearchReq, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+ /**
+ * @public
+ * @override
+ */
+ proto.cc.arduino.cli.commands.BoardSearchReq.displayName = 'proto.cc.arduino.cli.commands.BoardSearchReq';
+}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.cc.arduino.cli.commands.BoardSearchResp = function(opt_data) {
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.BoardSearchResp.repeatedFields_, null);
+};
+goog.inherits(proto.cc.arduino.cli.commands.BoardSearchResp, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+ /**
+ * @public
+ * @override
+ */
+ proto.cc.arduino.cli.commands.BoardSearchResp.displayName = 'proto.cc.arduino.cli.commands.BoardSearchResp';
+}
@@ -715,7 +759,8 @@ proto.cc.arduino.cli.commands.BoardDetailsResp.toObject = function(includeInstan
proto.cc.arduino.cli.commands.IdentificationPref.toObject, includeInstance),
programmersList: jspb.Message.toObjectList(msg.getProgrammersList(),
commands_common_pb.Programmer.toObject, includeInstance),
- debuggingSupported: jspb.Message.getBooleanFieldWithDefault(msg, 14, false)
+ debuggingSupported: jspb.Message.getBooleanFieldWithDefault(msg, 14, false),
+ serialnumber: jspb.Message.getFieldWithDefault(msg, 15, "")
};
if (includeInstance) {
@@ -814,6 +859,10 @@ proto.cc.arduino.cli.commands.BoardDetailsResp.deserializeBinaryFromReader = fun
var value = /** @type {boolean} */ (reader.readBool());
msg.setDebuggingSupported(value);
break;
+ case 15:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setSerialnumber(value);
+ break;
default:
reader.skipField();
break;
@@ -947,6 +996,13 @@ proto.cc.arduino.cli.commands.BoardDetailsResp.serializeBinaryToWriter = functio
f
);
}
+ f = message.getSerialnumber();
+ if (f.length > 0) {
+ writer.writeString(
+ 15,
+ f
+ );
+ }
};
@@ -1320,6 +1376,24 @@ proto.cc.arduino.cli.commands.BoardDetailsResp.prototype.setDebuggingSupported =
};
+/**
+ * optional string serialNumber = 15;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.BoardDetailsResp.prototype.getSerialnumber = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 15, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.BoardDetailsResp} returns this
+ */
+proto.cc.arduino.cli.commands.BoardDetailsResp.prototype.setSerialnumber = function(value) {
+ return jspb.Message.setProto3StringField(this, 15, value);
+};
+
+
@@ -4028,7 +4102,8 @@ proto.cc.arduino.cli.commands.DetectedPort.toObject = function(includeInstance,
protocol: jspb.Message.getFieldWithDefault(msg, 2, ""),
protocolLabel: jspb.Message.getFieldWithDefault(msg, 3, ""),
boardsList: jspb.Message.toObjectList(msg.getBoardsList(),
- proto.cc.arduino.cli.commands.BoardListItem.toObject, includeInstance)
+ proto.cc.arduino.cli.commands.BoardListItem.toObject, includeInstance),
+ serialNumber: jspb.Message.getFieldWithDefault(msg, 5, "")
};
if (includeInstance) {
@@ -4082,6 +4157,10 @@ proto.cc.arduino.cli.commands.DetectedPort.deserializeBinaryFromReader = functio
reader.readMessage(value,proto.cc.arduino.cli.commands.BoardListItem.deserializeBinaryFromReader);
msg.addBoards(value);
break;
+ case 5:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setSerialNumber(value);
+ break;
default:
reader.skipField();
break;
@@ -4140,6 +4219,13 @@ proto.cc.arduino.cli.commands.DetectedPort.serializeBinaryToWriter = function(me
proto.cc.arduino.cli.commands.BoardListItem.serializeBinaryToWriter
);
}
+ f = message.getSerialNumber();
+ if (f.length > 0) {
+ writer.writeString(
+ 5,
+ f
+ );
+ }
};
@@ -4235,6 +4321,24 @@ proto.cc.arduino.cli.commands.DetectedPort.prototype.clearBoardsList = function(
};
+/**
+ * optional string serial_number = 5;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.DetectedPort.prototype.getSerialNumber = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.DetectedPort} returns this
+ */
+proto.cc.arduino.cli.commands.DetectedPort.prototype.setSerialNumber = function(value) {
+ return jspb.Message.setProto3StringField(this, 5, value);
+};
+
+
/**
* List of repeated fields within this message type.
@@ -5060,7 +5164,8 @@ proto.cc.arduino.cli.commands.BoardListItem.toObject = function(includeInstance,
fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""),
isHidden: jspb.Message.getBooleanFieldWithDefault(msg, 3, false),
vid: jspb.Message.getFieldWithDefault(msg, 4, ""),
- pid: jspb.Message.getFieldWithDefault(msg, 5, "")
+ pid: jspb.Message.getFieldWithDefault(msg, 5, ""),
+ platform: (f = msg.getPlatform()) && commands_common_pb.Platform.toObject(includeInstance, f)
};
if (includeInstance) {
@@ -5117,6 +5222,11 @@ proto.cc.arduino.cli.commands.BoardListItem.deserializeBinaryFromReader = functi
var value = /** @type {string} */ (reader.readString());
msg.setPid(value);
break;
+ case 6:
+ var value = new commands_common_pb.Platform;
+ reader.readMessage(value,commands_common_pb.Platform.deserializeBinaryFromReader);
+ msg.setPlatform(value);
+ break;
default:
reader.skipField();
break;
@@ -5181,6 +5291,14 @@ proto.cc.arduino.cli.commands.BoardListItem.serializeBinaryToWriter = function(m
f
);
}
+ f = message.getPlatform();
+ if (f != null) {
+ writer.writeMessage(
+ 6,
+ f,
+ commands_common_pb.Platform.serializeBinaryToWriter
+ );
+ }
};
@@ -5274,4 +5392,412 @@ proto.cc.arduino.cli.commands.BoardListItem.prototype.setPid = function(value) {
};
+/**
+ * optional Platform platform = 6;
+ * @return {?proto.cc.arduino.cli.commands.Platform}
+ */
+proto.cc.arduino.cli.commands.BoardListItem.prototype.getPlatform = function() {
+ return /** @type{?proto.cc.arduino.cli.commands.Platform} */ (
+ jspb.Message.getWrapperField(this, commands_common_pb.Platform, 6));
+};
+
+
+/**
+ * @param {?proto.cc.arduino.cli.commands.Platform|undefined} value
+ * @return {!proto.cc.arduino.cli.commands.BoardListItem} returns this
+*/
+proto.cc.arduino.cli.commands.BoardListItem.prototype.setPlatform = function(value) {
+ return jspb.Message.setWrapperField(this, 6, value);
+};
+
+
+/**
+ * Clears the message field making it undefined.
+ * @return {!proto.cc.arduino.cli.commands.BoardListItem} returns this
+ */
+proto.cc.arduino.cli.commands.BoardListItem.prototype.clearPlatform = function() {
+ return this.setPlatform(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.cc.arduino.cli.commands.BoardListItem.prototype.hasPlatform = function() {
+ return jspb.Message.getField(this, 6) != null;
+};
+
+
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ * JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.prototype.toObject = function(opt_includeInstance) {
+ return proto.cc.arduino.cli.commands.BoardSearchReq.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ * the JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @param {!proto.cc.arduino.cli.commands.BoardSearchReq} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.toObject = function(includeInstance, msg) {
+ var f, obj = {
+ instance: (f = msg.getInstance()) && commands_common_pb.Instance.toObject(includeInstance, f),
+ searchArgs: jspb.Message.getFieldWithDefault(msg, 2, ""),
+ includeHiddenBoards: jspb.Message.getBooleanFieldWithDefault(msg, 3, false)
+ };
+
+ if (includeInstance) {
+ obj.$jspbMessageInstance = msg;
+ }
+ return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.cc.arduino.cli.commands.BoardSearchReq}
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.deserializeBinary = function(bytes) {
+ var reader = new jspb.BinaryReader(bytes);
+ var msg = new proto.cc.arduino.cli.commands.BoardSearchReq;
+ return proto.cc.arduino.cli.commands.BoardSearchReq.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.cc.arduino.cli.commands.BoardSearchReq} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.cc.arduino.cli.commands.BoardSearchReq}
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.deserializeBinaryFromReader = function(msg, reader) {
+ while (reader.nextField()) {
+ if (reader.isEndGroup()) {
+ break;
+ }
+ var field = reader.getFieldNumber();
+ switch (field) {
+ case 1:
+ var value = new commands_common_pb.Instance;
+ reader.readMessage(value,commands_common_pb.Instance.deserializeBinaryFromReader);
+ msg.setInstance(value);
+ break;
+ case 2:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setSearchArgs(value);
+ break;
+ case 3:
+ var value = /** @type {boolean} */ (reader.readBool());
+ msg.setIncludeHiddenBoards(value);
+ break;
+ default:
+ reader.skipField();
+ break;
+ }
+ }
+ return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.prototype.serializeBinary = function() {
+ var writer = new jspb.BinaryWriter();
+ proto.cc.arduino.cli.commands.BoardSearchReq.serializeBinaryToWriter(this, writer);
+ return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.cc.arduino.cli.commands.BoardSearchReq} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.serializeBinaryToWriter = function(message, writer) {
+ var f = undefined;
+ f = message.getInstance();
+ if (f != null) {
+ writer.writeMessage(
+ 1,
+ f,
+ commands_common_pb.Instance.serializeBinaryToWriter
+ );
+ }
+ f = message.getSearchArgs();
+ if (f.length > 0) {
+ writer.writeString(
+ 2,
+ f
+ );
+ }
+ f = message.getIncludeHiddenBoards();
+ if (f) {
+ writer.writeBool(
+ 3,
+ f
+ );
+ }
+};
+
+
+/**
+ * optional Instance instance = 1;
+ * @return {?proto.cc.arduino.cli.commands.Instance}
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.prototype.getInstance = function() {
+ return /** @type{?proto.cc.arduino.cli.commands.Instance} */ (
+ jspb.Message.getWrapperField(this, commands_common_pb.Instance, 1));
+};
+
+
+/**
+ * @param {?proto.cc.arduino.cli.commands.Instance|undefined} value
+ * @return {!proto.cc.arduino.cli.commands.BoardSearchReq} returns this
+*/
+proto.cc.arduino.cli.commands.BoardSearchReq.prototype.setInstance = function(value) {
+ return jspb.Message.setWrapperField(this, 1, value);
+};
+
+
+/**
+ * Clears the message field making it undefined.
+ * @return {!proto.cc.arduino.cli.commands.BoardSearchReq} returns this
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.prototype.clearInstance = function() {
+ return this.setInstance(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.prototype.hasInstance = function() {
+ return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional string search_args = 2;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.prototype.getSearchArgs = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.BoardSearchReq} returns this
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.prototype.setSearchArgs = function(value) {
+ return jspb.Message.setProto3StringField(this, 2, value);
+};
+
+
+/**
+ * optional bool include_hidden_boards = 3;
+ * @return {boolean}
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.prototype.getIncludeHiddenBoards = function() {
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
+};
+
+
+/**
+ * @param {boolean} value
+ * @return {!proto.cc.arduino.cli.commands.BoardSearchReq} returns this
+ */
+proto.cc.arduino.cli.commands.BoardSearchReq.prototype.setIncludeHiddenBoards = function(value) {
+ return jspb.Message.setProto3BooleanField(this, 3, value);
+};
+
+
+
+/**
+ * List of repeated fields within this message type.
+ * @private {!Array}
+ * @const
+ */
+proto.cc.arduino.cli.commands.BoardSearchResp.repeatedFields_ = [1];
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ * JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.cc.arduino.cli.commands.BoardSearchResp.prototype.toObject = function(opt_includeInstance) {
+ return proto.cc.arduino.cli.commands.BoardSearchResp.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ * the JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @param {!proto.cc.arduino.cli.commands.BoardSearchResp} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.cc.arduino.cli.commands.BoardSearchResp.toObject = function(includeInstance, msg) {
+ var f, obj = {
+ boardsList: jspb.Message.toObjectList(msg.getBoardsList(),
+ proto.cc.arduino.cli.commands.BoardListItem.toObject, includeInstance)
+ };
+
+ if (includeInstance) {
+ obj.$jspbMessageInstance = msg;
+ }
+ return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.cc.arduino.cli.commands.BoardSearchResp}
+ */
+proto.cc.arduino.cli.commands.BoardSearchResp.deserializeBinary = function(bytes) {
+ var reader = new jspb.BinaryReader(bytes);
+ var msg = new proto.cc.arduino.cli.commands.BoardSearchResp;
+ return proto.cc.arduino.cli.commands.BoardSearchResp.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.cc.arduino.cli.commands.BoardSearchResp} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.cc.arduino.cli.commands.BoardSearchResp}
+ */
+proto.cc.arduino.cli.commands.BoardSearchResp.deserializeBinaryFromReader = function(msg, reader) {
+ while (reader.nextField()) {
+ if (reader.isEndGroup()) {
+ break;
+ }
+ var field = reader.getFieldNumber();
+ switch (field) {
+ case 1:
+ var value = new proto.cc.arduino.cli.commands.BoardListItem;
+ reader.readMessage(value,proto.cc.arduino.cli.commands.BoardListItem.deserializeBinaryFromReader);
+ msg.addBoards(value);
+ break;
+ default:
+ reader.skipField();
+ break;
+ }
+ }
+ return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.cc.arduino.cli.commands.BoardSearchResp.prototype.serializeBinary = function() {
+ var writer = new jspb.BinaryWriter();
+ proto.cc.arduino.cli.commands.BoardSearchResp.serializeBinaryToWriter(this, writer);
+ return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.cc.arduino.cli.commands.BoardSearchResp} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.cc.arduino.cli.commands.BoardSearchResp.serializeBinaryToWriter = function(message, writer) {
+ var f = undefined;
+ f = message.getBoardsList();
+ if (f.length > 0) {
+ writer.writeRepeatedMessage(
+ 1,
+ f,
+ proto.cc.arduino.cli.commands.BoardListItem.serializeBinaryToWriter
+ );
+ }
+};
+
+
+/**
+ * repeated BoardListItem boards = 1;
+ * @return {!Array}
+ */
+proto.cc.arduino.cli.commands.BoardSearchResp.prototype.getBoardsList = function() {
+ return /** @type{!Array} */ (
+ jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.BoardListItem, 1));
+};
+
+
+/**
+ * @param {!Array} value
+ * @return {!proto.cc.arduino.cli.commands.BoardSearchResp} returns this
+*/
+proto.cc.arduino.cli.commands.BoardSearchResp.prototype.setBoardsList = function(value) {
+ return jspb.Message.setRepeatedWrapperField(this, 1, value);
+};
+
+
+/**
+ * @param {!proto.cc.arduino.cli.commands.BoardListItem=} opt_value
+ * @param {number=} opt_index
+ * @return {!proto.cc.arduino.cli.commands.BoardListItem}
+ */
+proto.cc.arduino.cli.commands.BoardSearchResp.prototype.addBoards = function(opt_value, opt_index) {
+ return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.cc.arduino.cli.commands.BoardListItem, opt_index);
+};
+
+
+/**
+ * Clears the list making it empty but non-null.
+ * @return {!proto.cc.arduino.cli.commands.BoardSearchResp} returns this
+ */
+proto.cc.arduino.cli.commands.BoardSearchResp.prototype.clearBoardsList = function() {
+ return this.setBoardsList([]);
+};
+
+
goog.object.extend(exports, proto.cc.arduino.cli.commands);
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/commands_grpc_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/commands/commands_grpc_pb.d.ts
index ff621647f..7d0bb0c43 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/commands_grpc_pb.d.ts
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/commands_grpc_pb.d.ts
@@ -30,6 +30,7 @@ interface IArduinoCoreService extends grpc.ServiceDefinition;
responseDeserialize: grpc.deserialize;
}
+interface IArduinoCoreService_IBoardSearch extends grpc.MethodDefinition {
+ path: "/cc.arduino.cli.commands.ArduinoCore/BoardSearch";
+ requestStream: false;
+ responseStream: false;
+ requestSerialize: grpc.serialize;
+ requestDeserialize: grpc.deserialize;
+ responseSerialize: grpc.serialize;
+ responseDeserialize: grpc.deserialize;
+}
interface IArduinoCoreService_IBoardListWatch extends grpc.MethodDefinition {
path: "/cc.arduino.cli.commands.ArduinoCore/BoardListWatch";
requestStream: true;
@@ -396,6 +406,7 @@ export interface IArduinoCoreServer {
boardAttach: grpc.handleServerStreamingCall;
boardList: grpc.handleUnaryCall;
boardListAll: grpc.handleUnaryCall;
+ boardSearch: grpc.handleUnaryCall;
boardListWatch: grpc.handleBidiStreamingCall;
compile: grpc.handleServerStreamingCall;
platformInstall: grpc.handleServerStreamingCall;
@@ -459,6 +470,9 @@ export interface IArduinoCoreClient {
boardListAll(request: commands_board_pb.BoardListAllReq, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardListAllResp) => void): grpc.ClientUnaryCall;
boardListAll(request: commands_board_pb.BoardListAllReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardListAllResp) => void): grpc.ClientUnaryCall;
boardListAll(request: commands_board_pb.BoardListAllReq, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardListAllResp) => void): grpc.ClientUnaryCall;
+ boardSearch(request: commands_board_pb.BoardSearchReq, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardSearchResp) => void): grpc.ClientUnaryCall;
+ boardSearch(request: commands_board_pb.BoardSearchReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardSearchResp) => void): grpc.ClientUnaryCall;
+ boardSearch(request: commands_board_pb.BoardSearchReq, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardSearchResp) => void): grpc.ClientUnaryCall;
boardListWatch(): grpc.ClientDuplexStream;
boardListWatch(options: Partial): grpc.ClientDuplexStream;
boardListWatch(metadata: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream;
@@ -551,6 +565,9 @@ export class ArduinoCoreClient extends grpc.Client implements IArduinoCoreClient
public boardListAll(request: commands_board_pb.BoardListAllReq, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardListAllResp) => void): grpc.ClientUnaryCall;
public boardListAll(request: commands_board_pb.BoardListAllReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardListAllResp) => void): grpc.ClientUnaryCall;
public boardListAll(request: commands_board_pb.BoardListAllReq, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardListAllResp) => void): grpc.ClientUnaryCall;
+ public boardSearch(request: commands_board_pb.BoardSearchReq, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardSearchResp) => void): grpc.ClientUnaryCall;
+ public boardSearch(request: commands_board_pb.BoardSearchReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardSearchResp) => void): grpc.ClientUnaryCall;
+ public boardSearch(request: commands_board_pb.BoardSearchReq, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: commands_board_pb.BoardSearchResp) => void): grpc.ClientUnaryCall;
public boardListWatch(options?: Partial): grpc.ClientDuplexStream;
public boardListWatch(metadata?: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream;
public compile(request: commands_compile_pb.CompileReq, options?: Partial): grpc.ClientReadableStream;
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/commands_grpc_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/commands_grpc_pb.js
index 3c7bb9b54..50648de90 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/commands_grpc_pb.js
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/commands_grpc_pb.js
@@ -157,6 +157,28 @@ function deserialize_cc_arduino_cli_commands_BoardListWatchResp(buffer_arg) {
return commands_board_pb.BoardListWatchResp.deserializeBinary(new Uint8Array(buffer_arg));
}
+function serialize_cc_arduino_cli_commands_BoardSearchReq(arg) {
+ if (!(arg instanceof commands_board_pb.BoardSearchReq)) {
+ throw new Error('Expected argument of type cc.arduino.cli.commands.BoardSearchReq');
+ }
+ return Buffer.from(arg.serializeBinary());
+}
+
+function deserialize_cc_arduino_cli_commands_BoardSearchReq(buffer_arg) {
+ return commands_board_pb.BoardSearchReq.deserializeBinary(new Uint8Array(buffer_arg));
+}
+
+function serialize_cc_arduino_cli_commands_BoardSearchResp(arg) {
+ if (!(arg instanceof commands_board_pb.BoardSearchResp)) {
+ throw new Error('Expected argument of type cc.arduino.cli.commands.BoardSearchResp');
+ }
+ return Buffer.from(arg.serializeBinary());
+}
+
+function deserialize_cc_arduino_cli_commands_BoardSearchResp(buffer_arg) {
+ return commands_board_pb.BoardSearchResp.deserializeBinary(new Uint8Array(buffer_arg));
+}
+
function serialize_cc_arduino_cli_commands_BurnBootloaderReq(arg) {
if (!(arg instanceof commands_upload_pb.BurnBootloaderReq)) {
throw new Error('Expected argument of type cc.arduino.cli.commands.BurnBootloaderReq');
@@ -1004,6 +1026,18 @@ boardListAll: {
responseSerialize: serialize_cc_arduino_cli_commands_BoardListAllResp,
responseDeserialize: deserialize_cc_arduino_cli_commands_BoardListAllResp,
},
+ // Search boards in installed and not installed Platforms.
+boardSearch: {
+ path: '/cc.arduino.cli.commands.ArduinoCore/BoardSearch',
+ requestStream: false,
+ responseStream: false,
+ requestType: commands_board_pb.BoardSearchReq,
+ responseType: commands_board_pb.BoardSearchResp,
+ requestSerialize: serialize_cc_arduino_cli_commands_BoardSearchReq,
+ requestDeserialize: deserialize_cc_arduino_cli_commands_BoardSearchReq,
+ responseSerialize: serialize_cc_arduino_cli_commands_BoardSearchResp,
+ responseDeserialize: deserialize_cc_arduino_cli_commands_BoardSearchResp,
+ },
// List boards connection and disconnected events.
boardListWatch: {
path: '/cc.arduino.cli.commands.ArduinoCore/BoardListWatch',
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.d.ts
index 8d6494f7f..deff5bd69 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.d.ts
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.d.ts
@@ -348,9 +348,9 @@ export class OutdatedResp extends jspb.Message {
addOutdatedLibrary(value?: commands_lib_pb.InstalledLibrary, index?: number): commands_lib_pb.InstalledLibrary;
clearOutdatedPlatformList(): void;
- getOutdatedPlatformList(): Array;
- setOutdatedPlatformList(value: Array): OutdatedResp;
- addOutdatedPlatform(value?: commands_core_pb.Platform, index?: number): commands_core_pb.Platform;
+ getOutdatedPlatformList(): Array;
+ setOutdatedPlatformList(value: Array): OutdatedResp;
+ addOutdatedPlatform(value?: commands_common_pb.Platform, index?: number): commands_common_pb.Platform;
serializeBinary(): Uint8Array;
@@ -366,7 +366,7 @@ export class OutdatedResp extends jspb.Message {
export namespace OutdatedResp {
export type AsObject = {
outdatedLibraryList: Array,
- outdatedPlatformList: Array,
+ outdatedPlatformList: Array,
}
}
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.js
index bb05ee3d0..caee3de24 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.js
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.js
@@ -2667,7 +2667,7 @@ proto.cc.arduino.cli.commands.OutdatedResp.toObject = function(includeInstance,
outdatedLibraryList: jspb.Message.toObjectList(msg.getOutdatedLibraryList(),
commands_lib_pb.InstalledLibrary.toObject, includeInstance),
outdatedPlatformList: jspb.Message.toObjectList(msg.getOutdatedPlatformList(),
- commands_core_pb.Platform.toObject, includeInstance)
+ commands_common_pb.Platform.toObject, includeInstance)
};
if (includeInstance) {
@@ -2710,8 +2710,8 @@ proto.cc.arduino.cli.commands.OutdatedResp.deserializeBinaryFromReader = functio
msg.addOutdatedLibrary(value);
break;
case 2:
- var value = new commands_core_pb.Platform;
- reader.readMessage(value,commands_core_pb.Platform.deserializeBinaryFromReader);
+ var value = new commands_common_pb.Platform;
+ reader.readMessage(value,commands_common_pb.Platform.deserializeBinaryFromReader);
msg.addOutdatedPlatform(value);
break;
default:
@@ -2756,7 +2756,7 @@ proto.cc.arduino.cli.commands.OutdatedResp.serializeBinaryToWriter = function(me
writer.writeRepeatedMessage(
2,
f,
- commands_core_pb.Platform.serializeBinaryToWriter
+ commands_common_pb.Platform.serializeBinaryToWriter
);
}
};
@@ -2806,7 +2806,7 @@ proto.cc.arduino.cli.commands.OutdatedResp.prototype.clearOutdatedLibraryList =
*/
proto.cc.arduino.cli.commands.OutdatedResp.prototype.getOutdatedPlatformList = function() {
return /** @type{!Array} */ (
- jspb.Message.getRepeatedWrapperField(this, commands_core_pb.Platform, 2));
+ jspb.Message.getRepeatedWrapperField(this, commands_common_pb.Platform, 2));
};
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.d.ts
index 2d4a7a01a..949726c16 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.d.ts
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.d.ts
@@ -121,3 +121,83 @@ export namespace Programmer {
name: string,
}
}
+
+export class Platform extends jspb.Message {
+ getId(): string;
+ setId(value: string): Platform;
+
+ getInstalled(): string;
+ setInstalled(value: string): Platform;
+
+ getLatest(): string;
+ setLatest(value: string): Platform;
+
+ getName(): string;
+ setName(value: string): Platform;
+
+ getMaintainer(): string;
+ setMaintainer(value: string): Platform;
+
+ getWebsite(): string;
+ setWebsite(value: string): Platform;
+
+ getEmail(): string;
+ setEmail(value: string): Platform;
+
+ clearBoardsList(): void;
+ getBoardsList(): Array;
+ setBoardsList(value: Array): Platform;
+ addBoards(value?: Board, index?: number): Board;
+
+ getManuallyinstalled(): boolean;
+ setManuallyinstalled(value: boolean): Platform;
+
+
+ serializeBinary(): Uint8Array;
+ toObject(includeInstance?: boolean): Platform.AsObject;
+ static toObject(includeInstance: boolean, msg: Platform): Platform.AsObject;
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo};
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo};
+ static serializeBinaryToWriter(message: Platform, writer: jspb.BinaryWriter): void;
+ static deserializeBinary(bytes: Uint8Array): Platform;
+ static deserializeBinaryFromReader(message: Platform, reader: jspb.BinaryReader): Platform;
+}
+
+export namespace Platform {
+ export type AsObject = {
+ id: string,
+ installed: string,
+ latest: string,
+ name: string,
+ maintainer: string,
+ website: string,
+ email: string,
+ boardsList: Array,
+ manuallyinstalled: boolean,
+ }
+}
+
+export class Board extends jspb.Message {
+ getName(): string;
+ setName(value: string): Board;
+
+ getFqbn(): string;
+ setFqbn(value: string): Board;
+
+
+ serializeBinary(): Uint8Array;
+ toObject(includeInstance?: boolean): Board.AsObject;
+ static toObject(includeInstance: boolean, msg: Board): Board.AsObject;
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo};
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo};
+ static serializeBinaryToWriter(message: Board, writer: jspb.BinaryWriter): void;
+ static deserializeBinary(bytes: Uint8Array): Board;
+ static deserializeBinaryFromReader(message: Board, reader: jspb.BinaryReader): Board;
+}
+
+export namespace Board {
+ export type AsObject = {
+ name: string,
+ fqbn: string,
+ }
+}
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.js
index 82f44943b..fa5c25219 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.js
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/common_pb.js
@@ -14,8 +14,10 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
+goog.exportSymbol('proto.cc.arduino.cli.commands.Board', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.DownloadProgress', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.Instance', null, global);
+goog.exportSymbol('proto.cc.arduino.cli.commands.Platform', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.Programmer', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.TaskProgress', null, global);
/**
@@ -102,6 +104,48 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.cc.arduino.cli.commands.Programmer.displayName = 'proto.cc.arduino.cli.commands.Programmer';
}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.cc.arduino.cli.commands.Platform = function(opt_data) {
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.Platform.repeatedFields_, null);
+};
+goog.inherits(proto.cc.arduino.cli.commands.Platform, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+ /**
+ * @public
+ * @override
+ */
+ proto.cc.arduino.cli.commands.Platform.displayName = 'proto.cc.arduino.cli.commands.Platform';
+}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.cc.arduino.cli.commands.Board = function(opt_data) {
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.cc.arduino.cli.commands.Board, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+ /**
+ * @public
+ * @override
+ */
+ proto.cc.arduino.cli.commands.Board.displayName = 'proto.cc.arduino.cli.commands.Board';
+}
@@ -862,4 +906,564 @@ proto.cc.arduino.cli.commands.Programmer.prototype.setName = function(value) {
};
+
+/**
+ * List of repeated fields within this message type.
+ * @private {!Array}
+ * @const
+ */
+proto.cc.arduino.cli.commands.Platform.repeatedFields_ = [8];
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ * JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.toObject = function(opt_includeInstance) {
+ return proto.cc.arduino.cli.commands.Platform.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ * the JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @param {!proto.cc.arduino.cli.commands.Platform} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.cc.arduino.cli.commands.Platform.toObject = function(includeInstance, msg) {
+ var f, obj = {
+ id: jspb.Message.getFieldWithDefault(msg, 1, ""),
+ installed: jspb.Message.getFieldWithDefault(msg, 2, ""),
+ latest: jspb.Message.getFieldWithDefault(msg, 3, ""),
+ name: jspb.Message.getFieldWithDefault(msg, 4, ""),
+ maintainer: jspb.Message.getFieldWithDefault(msg, 5, ""),
+ website: jspb.Message.getFieldWithDefault(msg, 6, ""),
+ email: jspb.Message.getFieldWithDefault(msg, 7, ""),
+ boardsList: jspb.Message.toObjectList(msg.getBoardsList(),
+ proto.cc.arduino.cli.commands.Board.toObject, includeInstance),
+ manuallyinstalled: jspb.Message.getBooleanFieldWithDefault(msg, 9, false)
+ };
+
+ if (includeInstance) {
+ obj.$jspbMessageInstance = msg;
+ }
+ return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.cc.arduino.cli.commands.Platform}
+ */
+proto.cc.arduino.cli.commands.Platform.deserializeBinary = function(bytes) {
+ var reader = new jspb.BinaryReader(bytes);
+ var msg = new proto.cc.arduino.cli.commands.Platform;
+ return proto.cc.arduino.cli.commands.Platform.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.cc.arduino.cli.commands.Platform} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.cc.arduino.cli.commands.Platform}
+ */
+proto.cc.arduino.cli.commands.Platform.deserializeBinaryFromReader = function(msg, reader) {
+ while (reader.nextField()) {
+ if (reader.isEndGroup()) {
+ break;
+ }
+ var field = reader.getFieldNumber();
+ switch (field) {
+ case 1:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setId(value);
+ break;
+ case 2:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setInstalled(value);
+ break;
+ case 3:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setLatest(value);
+ break;
+ case 4:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setName(value);
+ break;
+ case 5:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setMaintainer(value);
+ break;
+ case 6:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setWebsite(value);
+ break;
+ case 7:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setEmail(value);
+ break;
+ case 8:
+ var value = new proto.cc.arduino.cli.commands.Board;
+ reader.readMessage(value,proto.cc.arduino.cli.commands.Board.deserializeBinaryFromReader);
+ msg.addBoards(value);
+ break;
+ case 9:
+ var value = /** @type {boolean} */ (reader.readBool());
+ msg.setManuallyinstalled(value);
+ break;
+ default:
+ reader.skipField();
+ break;
+ }
+ }
+ return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.serializeBinary = function() {
+ var writer = new jspb.BinaryWriter();
+ proto.cc.arduino.cli.commands.Platform.serializeBinaryToWriter(this, writer);
+ return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.cc.arduino.cli.commands.Platform} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.cc.arduino.cli.commands.Platform.serializeBinaryToWriter = function(message, writer) {
+ var f = undefined;
+ f = message.getId();
+ if (f.length > 0) {
+ writer.writeString(
+ 1,
+ f
+ );
+ }
+ f = message.getInstalled();
+ if (f.length > 0) {
+ writer.writeString(
+ 2,
+ f
+ );
+ }
+ f = message.getLatest();
+ if (f.length > 0) {
+ writer.writeString(
+ 3,
+ f
+ );
+ }
+ f = message.getName();
+ if (f.length > 0) {
+ writer.writeString(
+ 4,
+ f
+ );
+ }
+ f = message.getMaintainer();
+ if (f.length > 0) {
+ writer.writeString(
+ 5,
+ f
+ );
+ }
+ f = message.getWebsite();
+ if (f.length > 0) {
+ writer.writeString(
+ 6,
+ f
+ );
+ }
+ f = message.getEmail();
+ if (f.length > 0) {
+ writer.writeString(
+ 7,
+ f
+ );
+ }
+ f = message.getBoardsList();
+ if (f.length > 0) {
+ writer.writeRepeatedMessage(
+ 8,
+ f,
+ proto.cc.arduino.cli.commands.Board.serializeBinaryToWriter
+ );
+ }
+ f = message.getManuallyinstalled();
+ if (f) {
+ writer.writeBool(
+ 9,
+ f
+ );
+ }
+};
+
+
+/**
+ * optional string ID = 1;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.getId = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.Platform} returns this
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.setId = function(value) {
+ return jspb.Message.setProto3StringField(this, 1, value);
+};
+
+
+/**
+ * optional string Installed = 2;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.getInstalled = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.Platform} returns this
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.setInstalled = function(value) {
+ return jspb.Message.setProto3StringField(this, 2, value);
+};
+
+
+/**
+ * optional string Latest = 3;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.getLatest = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.Platform} returns this
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.setLatest = function(value) {
+ return jspb.Message.setProto3StringField(this, 3, value);
+};
+
+
+/**
+ * optional string Name = 4;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.getName = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.Platform} returns this
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.setName = function(value) {
+ return jspb.Message.setProto3StringField(this, 4, value);
+};
+
+
+/**
+ * optional string Maintainer = 5;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.getMaintainer = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.Platform} returns this
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.setMaintainer = function(value) {
+ return jspb.Message.setProto3StringField(this, 5, value);
+};
+
+
+/**
+ * optional string Website = 6;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.getWebsite = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.Platform} returns this
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.setWebsite = function(value) {
+ return jspb.Message.setProto3StringField(this, 6, value);
+};
+
+
+/**
+ * optional string Email = 7;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.getEmail = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.Platform} returns this
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.setEmail = function(value) {
+ return jspb.Message.setProto3StringField(this, 7, value);
+};
+
+
+/**
+ * repeated Board Boards = 8;
+ * @return {!Array}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.getBoardsList = function() {
+ return /** @type{!Array} */ (
+ jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.Board, 8));
+};
+
+
+/**
+ * @param {!Array} value
+ * @return {!proto.cc.arduino.cli.commands.Platform} returns this
+*/
+proto.cc.arduino.cli.commands.Platform.prototype.setBoardsList = function(value) {
+ return jspb.Message.setRepeatedWrapperField(this, 8, value);
+};
+
+
+/**
+ * @param {!proto.cc.arduino.cli.commands.Board=} opt_value
+ * @param {number=} opt_index
+ * @return {!proto.cc.arduino.cli.commands.Board}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.addBoards = function(opt_value, opt_index) {
+ return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.cc.arduino.cli.commands.Board, opt_index);
+};
+
+
+/**
+ * Clears the list making it empty but non-null.
+ * @return {!proto.cc.arduino.cli.commands.Platform} returns this
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.clearBoardsList = function() {
+ return this.setBoardsList([]);
+};
+
+
+/**
+ * optional bool ManuallyInstalled = 9;
+ * @return {boolean}
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.getManuallyinstalled = function() {
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false));
+};
+
+
+/**
+ * @param {boolean} value
+ * @return {!proto.cc.arduino.cli.commands.Platform} returns this
+ */
+proto.cc.arduino.cli.commands.Platform.prototype.setManuallyinstalled = function(value) {
+ return jspb.Message.setProto3BooleanField(this, 9, value);
+};
+
+
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ * JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.cc.arduino.cli.commands.Board.prototype.toObject = function(opt_includeInstance) {
+ return proto.cc.arduino.cli.commands.Board.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ * the JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @param {!proto.cc.arduino.cli.commands.Board} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.cc.arduino.cli.commands.Board.toObject = function(includeInstance, msg) {
+ var f, obj = {
+ name: jspb.Message.getFieldWithDefault(msg, 1, ""),
+ fqbn: jspb.Message.getFieldWithDefault(msg, 2, "")
+ };
+
+ if (includeInstance) {
+ obj.$jspbMessageInstance = msg;
+ }
+ return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.cc.arduino.cli.commands.Board}
+ */
+proto.cc.arduino.cli.commands.Board.deserializeBinary = function(bytes) {
+ var reader = new jspb.BinaryReader(bytes);
+ var msg = new proto.cc.arduino.cli.commands.Board;
+ return proto.cc.arduino.cli.commands.Board.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.cc.arduino.cli.commands.Board} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.cc.arduino.cli.commands.Board}
+ */
+proto.cc.arduino.cli.commands.Board.deserializeBinaryFromReader = function(msg, reader) {
+ while (reader.nextField()) {
+ if (reader.isEndGroup()) {
+ break;
+ }
+ var field = reader.getFieldNumber();
+ switch (field) {
+ case 1:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setName(value);
+ break;
+ case 2:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setFqbn(value);
+ break;
+ default:
+ reader.skipField();
+ break;
+ }
+ }
+ return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.cc.arduino.cli.commands.Board.prototype.serializeBinary = function() {
+ var writer = new jspb.BinaryWriter();
+ proto.cc.arduino.cli.commands.Board.serializeBinaryToWriter(this, writer);
+ return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.cc.arduino.cli.commands.Board} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.cc.arduino.cli.commands.Board.serializeBinaryToWriter = function(message, writer) {
+ var f = undefined;
+ f = message.getName();
+ if (f.length > 0) {
+ writer.writeString(
+ 1,
+ f
+ );
+ }
+ f = message.getFqbn();
+ if (f.length > 0) {
+ writer.writeString(
+ 2,
+ f
+ );
+ }
+};
+
+
+/**
+ * optional string name = 1;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.Board.prototype.getName = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.Board} returns this
+ */
+proto.cc.arduino.cli.commands.Board.prototype.setName = function(value) {
+ return jspb.Message.setProto3StringField(this, 1, value);
+};
+
+
+/**
+ * optional string fqbn = 2;
+ * @return {string}
+ */
+proto.cc.arduino.cli.commands.Board.prototype.getFqbn = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.cc.arduino.cli.commands.Board} returns this
+ */
+proto.cc.arduino.cli.commands.Board.prototype.setFqbn = function(value) {
+ return jspb.Message.setProto3StringField(this, 2, value);
+};
+
+
goog.object.extend(exports, proto.cc.arduino.cli.commands);
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.d.ts
index 3f8155593..2ffc615c6 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.d.ts
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.d.ts
@@ -295,9 +295,9 @@ export namespace PlatformSearchReq {
export class PlatformSearchResp extends jspb.Message {
clearSearchOutputList(): void;
- getSearchOutputList(): Array;
- setSearchOutputList(value: Array): PlatformSearchResp;
- addSearchOutput(value?: Platform, index?: number): Platform;
+ getSearchOutputList(): Array;
+ setSearchOutputList(value: Array): PlatformSearchResp;
+ addSearchOutput(value?: commands_common_pb.Platform, index?: number): commands_common_pb.Platform;
serializeBinary(): Uint8Array;
@@ -312,7 +312,7 @@ export class PlatformSearchResp extends jspb.Message {
export namespace PlatformSearchResp {
export type AsObject = {
- searchOutputList: Array,
+ searchOutputList: Array,
}
}
@@ -350,9 +350,9 @@ export namespace PlatformListReq {
export class PlatformListResp extends jspb.Message {
clearInstalledPlatformList(): void;
- getInstalledPlatformList(): Array;
- setInstalledPlatformList(value: Array): PlatformListResp;
- addInstalledPlatform(value?: Platform, index?: number): Platform;
+ getInstalledPlatformList(): Array;
+ setInstalledPlatformList(value: Array): PlatformListResp;
+ addInstalledPlatform(value?: commands_common_pb.Platform, index?: number): commands_common_pb.Platform;
serializeBinary(): Uint8Array;
@@ -367,86 +367,6 @@ export class PlatformListResp extends jspb.Message {
export namespace PlatformListResp {
export type AsObject = {
- installedPlatformList: Array,
- }
-}
-
-export class Platform extends jspb.Message {
- getId(): string;
- setId(value: string): Platform;
-
- getInstalled(): string;
- setInstalled(value: string): Platform;
-
- getLatest(): string;
- setLatest(value: string): Platform;
-
- getName(): string;
- setName(value: string): Platform;
-
- getMaintainer(): string;
- setMaintainer(value: string): Platform;
-
- getWebsite(): string;
- setWebsite(value: string): Platform;
-
- getEmail(): string;
- setEmail(value: string): Platform;
-
- clearBoardsList(): void;
- getBoardsList(): Array;
- setBoardsList(value: Array): Platform;
- addBoards(value?: Board, index?: number): Board;
-
- getManuallyinstalled(): boolean;
- setManuallyinstalled(value: boolean): Platform;
-
-
- serializeBinary(): Uint8Array;
- toObject(includeInstance?: boolean): Platform.AsObject;
- static toObject(includeInstance: boolean, msg: Platform): Platform.AsObject;
- static extensions: {[key: number]: jspb.ExtensionFieldInfo};
- static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo};
- static serializeBinaryToWriter(message: Platform, writer: jspb.BinaryWriter): void;
- static deserializeBinary(bytes: Uint8Array): Platform;
- static deserializeBinaryFromReader(message: Platform, reader: jspb.BinaryReader): Platform;
-}
-
-export namespace Platform {
- export type AsObject = {
- id: string,
- installed: string,
- latest: string,
- name: string,
- maintainer: string,
- website: string,
- email: string,
- boardsList: Array,
- manuallyinstalled: boolean,
- }
-}
-
-export class Board extends jspb.Message {
- getName(): string;
- setName(value: string): Board;
-
- getFqbn(): string;
- setFqbn(value: string): Board;
-
-
- serializeBinary(): Uint8Array;
- toObject(includeInstance?: boolean): Board.AsObject;
- static toObject(includeInstance: boolean, msg: Board): Board.AsObject;
- static extensions: {[key: number]: jspb.ExtensionFieldInfo};
- static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo};
- static serializeBinaryToWriter(message: Board, writer: jspb.BinaryWriter): void;
- static deserializeBinary(bytes: Uint8Array): Board;
- static deserializeBinaryFromReader(message: Board, reader: jspb.BinaryReader): Board;
-}
-
-export namespace Board {
- export type AsObject = {
- name: string,
- fqbn: string,
+ installedPlatformList: Array,
}
}
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.js
index 19a9db769..7d0990dcc 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.js
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/core_pb.js
@@ -16,8 +16,6 @@ var global = Function('return this')();
var commands_common_pb = require('../commands/common_pb.js');
goog.object.extend(proto, commands_common_pb);
-goog.exportSymbol('proto.cc.arduino.cli.commands.Board', null, global);
-goog.exportSymbol('proto.cc.arduino.cli.commands.Platform', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.PlatformDownloadReq', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.PlatformDownloadResp', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.PlatformInstallReq', null, global);
@@ -282,48 +280,6 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.cc.arduino.cli.commands.PlatformListResp.displayName = 'proto.cc.arduino.cli.commands.PlatformListResp';
}
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.cc.arduino.cli.commands.Platform = function(opt_data) {
- jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.Platform.repeatedFields_, null);
-};
-goog.inherits(proto.cc.arduino.cli.commands.Platform, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
- /**
- * @public
- * @override
- */
- proto.cc.arduino.cli.commands.Platform.displayName = 'proto.cc.arduino.cli.commands.Platform';
-}
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.cc.arduino.cli.commands.Board = function(opt_data) {
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
-};
-goog.inherits(proto.cc.arduino.cli.commands.Board, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
- /**
- * @public
- * @override
- */
- proto.cc.arduino.cli.commands.Board.displayName = 'proto.cc.arduino.cli.commands.Board';
-}
@@ -2245,7 +2201,7 @@ proto.cc.arduino.cli.commands.PlatformSearchResp.prototype.toObject = function(o
proto.cc.arduino.cli.commands.PlatformSearchResp.toObject = function(includeInstance, msg) {
var f, obj = {
searchOutputList: jspb.Message.toObjectList(msg.getSearchOutputList(),
- proto.cc.arduino.cli.commands.Platform.toObject, includeInstance)
+ commands_common_pb.Platform.toObject, includeInstance)
};
if (includeInstance) {
@@ -2283,8 +2239,8 @@ proto.cc.arduino.cli.commands.PlatformSearchResp.deserializeBinaryFromReader = f
var field = reader.getFieldNumber();
switch (field) {
case 1:
- var value = new proto.cc.arduino.cli.commands.Platform;
- reader.readMessage(value,proto.cc.arduino.cli.commands.Platform.deserializeBinaryFromReader);
+ var value = new commands_common_pb.Platform;
+ reader.readMessage(value,commands_common_pb.Platform.deserializeBinaryFromReader);
msg.addSearchOutput(value);
break;
default:
@@ -2321,7 +2277,7 @@ proto.cc.arduino.cli.commands.PlatformSearchResp.serializeBinaryToWriter = funct
writer.writeRepeatedMessage(
1,
f,
- proto.cc.arduino.cli.commands.Platform.serializeBinaryToWriter
+ commands_common_pb.Platform.serializeBinaryToWriter
);
}
};
@@ -2333,7 +2289,7 @@ proto.cc.arduino.cli.commands.PlatformSearchResp.serializeBinaryToWriter = funct
*/
proto.cc.arduino.cli.commands.PlatformSearchResp.prototype.getSearchOutputList = function() {
return /** @type{!Array} */ (
- jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.Platform, 1));
+ jspb.Message.getRepeatedWrapperField(this, commands_common_pb.Platform, 1));
};
@@ -2616,7 +2572,7 @@ proto.cc.arduino.cli.commands.PlatformListResp.prototype.toObject = function(opt
proto.cc.arduino.cli.commands.PlatformListResp.toObject = function(includeInstance, msg) {
var f, obj = {
installedPlatformList: jspb.Message.toObjectList(msg.getInstalledPlatformList(),
- proto.cc.arduino.cli.commands.Platform.toObject, includeInstance)
+ commands_common_pb.Platform.toObject, includeInstance)
};
if (includeInstance) {
@@ -2654,8 +2610,8 @@ proto.cc.arduino.cli.commands.PlatformListResp.deserializeBinaryFromReader = fun
var field = reader.getFieldNumber();
switch (field) {
case 1:
- var value = new proto.cc.arduino.cli.commands.Platform;
- reader.readMessage(value,proto.cc.arduino.cli.commands.Platform.deserializeBinaryFromReader);
+ var value = new commands_common_pb.Platform;
+ reader.readMessage(value,commands_common_pb.Platform.deserializeBinaryFromReader);
msg.addInstalledPlatform(value);
break;
default:
@@ -2692,7 +2648,7 @@ proto.cc.arduino.cli.commands.PlatformListResp.serializeBinaryToWriter = functio
writer.writeRepeatedMessage(
1,
f,
- proto.cc.arduino.cli.commands.Platform.serializeBinaryToWriter
+ commands_common_pb.Platform.serializeBinaryToWriter
);
}
};
@@ -2704,7 +2660,7 @@ proto.cc.arduino.cli.commands.PlatformListResp.serializeBinaryToWriter = functio
*/
proto.cc.arduino.cli.commands.PlatformListResp.prototype.getInstalledPlatformList = function() {
return /** @type{!Array} */ (
- jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.Platform, 1));
+ jspb.Message.getRepeatedWrapperField(this, commands_common_pb.Platform, 1));
};
@@ -2736,564 +2692,4 @@ proto.cc.arduino.cli.commands.PlatformListResp.prototype.clearInstalledPlatformL
};
-
-/**
- * List of repeated fields within this message type.
- * @private {!Array}
- * @const
- */
-proto.cc.arduino.cli.commands.Platform.repeatedFields_ = [8];
-
-
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * Optional fields that are not set will be set to undefined.
- * To access a reserved field use, foo.pb_, eg, foo.pb_default.
- * For the list of reserved names please see:
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
- * JSPB instance for transitional soy proto support:
- * http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.toObject = function(opt_includeInstance) {
- return proto.cc.arduino.cli.commands.Platform.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
- * the JSPB instance for transitional soy proto support:
- * http://goto/soy-param-migration
- * @param {!proto.cc.arduino.cli.commands.Platform} msg The msg instance to transform.
- * @return {!Object}
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.cc.arduino.cli.commands.Platform.toObject = function(includeInstance, msg) {
- var f, obj = {
- id: jspb.Message.getFieldWithDefault(msg, 1, ""),
- installed: jspb.Message.getFieldWithDefault(msg, 2, ""),
- latest: jspb.Message.getFieldWithDefault(msg, 3, ""),
- name: jspb.Message.getFieldWithDefault(msg, 4, ""),
- maintainer: jspb.Message.getFieldWithDefault(msg, 5, ""),
- website: jspb.Message.getFieldWithDefault(msg, 6, ""),
- email: jspb.Message.getFieldWithDefault(msg, 7, ""),
- boardsList: jspb.Message.toObjectList(msg.getBoardsList(),
- proto.cc.arduino.cli.commands.Board.toObject, includeInstance),
- manuallyinstalled: jspb.Message.getBooleanFieldWithDefault(msg, 9, false)
- };
-
- if (includeInstance) {
- obj.$jspbMessageInstance = msg;
- }
- return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.cc.arduino.cli.commands.Platform}
- */
-proto.cc.arduino.cli.commands.Platform.deserializeBinary = function(bytes) {
- var reader = new jspb.BinaryReader(bytes);
- var msg = new proto.cc.arduino.cli.commands.Platform;
- return proto.cc.arduino.cli.commands.Platform.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.cc.arduino.cli.commands.Platform} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.cc.arduino.cli.commands.Platform}
- */
-proto.cc.arduino.cli.commands.Platform.deserializeBinaryFromReader = function(msg, reader) {
- while (reader.nextField()) {
- if (reader.isEndGroup()) {
- break;
- }
- var field = reader.getFieldNumber();
- switch (field) {
- case 1:
- var value = /** @type {string} */ (reader.readString());
- msg.setId(value);
- break;
- case 2:
- var value = /** @type {string} */ (reader.readString());
- msg.setInstalled(value);
- break;
- case 3:
- var value = /** @type {string} */ (reader.readString());
- msg.setLatest(value);
- break;
- case 4:
- var value = /** @type {string} */ (reader.readString());
- msg.setName(value);
- break;
- case 5:
- var value = /** @type {string} */ (reader.readString());
- msg.setMaintainer(value);
- break;
- case 6:
- var value = /** @type {string} */ (reader.readString());
- msg.setWebsite(value);
- break;
- case 7:
- var value = /** @type {string} */ (reader.readString());
- msg.setEmail(value);
- break;
- case 8:
- var value = new proto.cc.arduino.cli.commands.Board;
- reader.readMessage(value,proto.cc.arduino.cli.commands.Board.deserializeBinaryFromReader);
- msg.addBoards(value);
- break;
- case 9:
- var value = /** @type {boolean} */ (reader.readBool());
- msg.setManuallyinstalled(value);
- break;
- default:
- reader.skipField();
- break;
- }
- }
- return msg;
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.serializeBinary = function() {
- var writer = new jspb.BinaryWriter();
- proto.cc.arduino.cli.commands.Platform.serializeBinaryToWriter(this, writer);
- return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the given message to binary data (in protobuf wire
- * format), writing to the given BinaryWriter.
- * @param {!proto.cc.arduino.cli.commands.Platform} message
- * @param {!jspb.BinaryWriter} writer
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.cc.arduino.cli.commands.Platform.serializeBinaryToWriter = function(message, writer) {
- var f = undefined;
- f = message.getId();
- if (f.length > 0) {
- writer.writeString(
- 1,
- f
- );
- }
- f = message.getInstalled();
- if (f.length > 0) {
- writer.writeString(
- 2,
- f
- );
- }
- f = message.getLatest();
- if (f.length > 0) {
- writer.writeString(
- 3,
- f
- );
- }
- f = message.getName();
- if (f.length > 0) {
- writer.writeString(
- 4,
- f
- );
- }
- f = message.getMaintainer();
- if (f.length > 0) {
- writer.writeString(
- 5,
- f
- );
- }
- f = message.getWebsite();
- if (f.length > 0) {
- writer.writeString(
- 6,
- f
- );
- }
- f = message.getEmail();
- if (f.length > 0) {
- writer.writeString(
- 7,
- f
- );
- }
- f = message.getBoardsList();
- if (f.length > 0) {
- writer.writeRepeatedMessage(
- 8,
- f,
- proto.cc.arduino.cli.commands.Board.serializeBinaryToWriter
- );
- }
- f = message.getManuallyinstalled();
- if (f) {
- writer.writeBool(
- 9,
- f
- );
- }
-};
-
-
-/**
- * optional string ID = 1;
- * @return {string}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.getId = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.cc.arduino.cli.commands.Platform} returns this
- */
-proto.cc.arduino.cli.commands.Platform.prototype.setId = function(value) {
- return jspb.Message.setProto3StringField(this, 1, value);
-};
-
-
-/**
- * optional string Installed = 2;
- * @return {string}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.getInstalled = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.cc.arduino.cli.commands.Platform} returns this
- */
-proto.cc.arduino.cli.commands.Platform.prototype.setInstalled = function(value) {
- return jspb.Message.setProto3StringField(this, 2, value);
-};
-
-
-/**
- * optional string Latest = 3;
- * @return {string}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.getLatest = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.cc.arduino.cli.commands.Platform} returns this
- */
-proto.cc.arduino.cli.commands.Platform.prototype.setLatest = function(value) {
- return jspb.Message.setProto3StringField(this, 3, value);
-};
-
-
-/**
- * optional string Name = 4;
- * @return {string}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.getName = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.cc.arduino.cli.commands.Platform} returns this
- */
-proto.cc.arduino.cli.commands.Platform.prototype.setName = function(value) {
- return jspb.Message.setProto3StringField(this, 4, value);
-};
-
-
-/**
- * optional string Maintainer = 5;
- * @return {string}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.getMaintainer = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.cc.arduino.cli.commands.Platform} returns this
- */
-proto.cc.arduino.cli.commands.Platform.prototype.setMaintainer = function(value) {
- return jspb.Message.setProto3StringField(this, 5, value);
-};
-
-
-/**
- * optional string Website = 6;
- * @return {string}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.getWebsite = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.cc.arduino.cli.commands.Platform} returns this
- */
-proto.cc.arduino.cli.commands.Platform.prototype.setWebsite = function(value) {
- return jspb.Message.setProto3StringField(this, 6, value);
-};
-
-
-/**
- * optional string Email = 7;
- * @return {string}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.getEmail = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.cc.arduino.cli.commands.Platform} returns this
- */
-proto.cc.arduino.cli.commands.Platform.prototype.setEmail = function(value) {
- return jspb.Message.setProto3StringField(this, 7, value);
-};
-
-
-/**
- * repeated Board Boards = 8;
- * @return {!Array}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.getBoardsList = function() {
- return /** @type{!Array} */ (
- jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.Board, 8));
-};
-
-
-/**
- * @param {!Array} value
- * @return {!proto.cc.arduino.cli.commands.Platform} returns this
-*/
-proto.cc.arduino.cli.commands.Platform.prototype.setBoardsList = function(value) {
- return jspb.Message.setRepeatedWrapperField(this, 8, value);
-};
-
-
-/**
- * @param {!proto.cc.arduino.cli.commands.Board=} opt_value
- * @param {number=} opt_index
- * @return {!proto.cc.arduino.cli.commands.Board}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.addBoards = function(opt_value, opt_index) {
- return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.cc.arduino.cli.commands.Board, opt_index);
-};
-
-
-/**
- * Clears the list making it empty but non-null.
- * @return {!proto.cc.arduino.cli.commands.Platform} returns this
- */
-proto.cc.arduino.cli.commands.Platform.prototype.clearBoardsList = function() {
- return this.setBoardsList([]);
-};
-
-
-/**
- * optional bool ManuallyInstalled = 9;
- * @return {boolean}
- */
-proto.cc.arduino.cli.commands.Platform.prototype.getManuallyinstalled = function() {
- return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false));
-};
-
-
-/**
- * @param {boolean} value
- * @return {!proto.cc.arduino.cli.commands.Platform} returns this
- */
-proto.cc.arduino.cli.commands.Platform.prototype.setManuallyinstalled = function(value) {
- return jspb.Message.setProto3BooleanField(this, 9, value);
-};
-
-
-
-
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * Optional fields that are not set will be set to undefined.
- * To access a reserved field use, foo.pb_, eg, foo.pb_default.
- * For the list of reserved names please see:
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
- * JSPB instance for transitional soy proto support:
- * http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.cc.arduino.cli.commands.Board.prototype.toObject = function(opt_includeInstance) {
- return proto.cc.arduino.cli.commands.Board.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
- * the JSPB instance for transitional soy proto support:
- * http://goto/soy-param-migration
- * @param {!proto.cc.arduino.cli.commands.Board} msg The msg instance to transform.
- * @return {!Object}
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.cc.arduino.cli.commands.Board.toObject = function(includeInstance, msg) {
- var f, obj = {
- name: jspb.Message.getFieldWithDefault(msg, 1, ""),
- fqbn: jspb.Message.getFieldWithDefault(msg, 2, "")
- };
-
- if (includeInstance) {
- obj.$jspbMessageInstance = msg;
- }
- return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.cc.arduino.cli.commands.Board}
- */
-proto.cc.arduino.cli.commands.Board.deserializeBinary = function(bytes) {
- var reader = new jspb.BinaryReader(bytes);
- var msg = new proto.cc.arduino.cli.commands.Board;
- return proto.cc.arduino.cli.commands.Board.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.cc.arduino.cli.commands.Board} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.cc.arduino.cli.commands.Board}
- */
-proto.cc.arduino.cli.commands.Board.deserializeBinaryFromReader = function(msg, reader) {
- while (reader.nextField()) {
- if (reader.isEndGroup()) {
- break;
- }
- var field = reader.getFieldNumber();
- switch (field) {
- case 1:
- var value = /** @type {string} */ (reader.readString());
- msg.setName(value);
- break;
- case 2:
- var value = /** @type {string} */ (reader.readString());
- msg.setFqbn(value);
- break;
- default:
- reader.skipField();
- break;
- }
- }
- return msg;
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.cc.arduino.cli.commands.Board.prototype.serializeBinary = function() {
- var writer = new jspb.BinaryWriter();
- proto.cc.arduino.cli.commands.Board.serializeBinaryToWriter(this, writer);
- return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the given message to binary data (in protobuf wire
- * format), writing to the given BinaryWriter.
- * @param {!proto.cc.arduino.cli.commands.Board} message
- * @param {!jspb.BinaryWriter} writer
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.cc.arduino.cli.commands.Board.serializeBinaryToWriter = function(message, writer) {
- var f = undefined;
- f = message.getName();
- if (f.length > 0) {
- writer.writeString(
- 1,
- f
- );
- }
- f = message.getFqbn();
- if (f.length > 0) {
- writer.writeString(
- 2,
- f
- );
- }
-};
-
-
-/**
- * optional string name = 1;
- * @return {string}
- */
-proto.cc.arduino.cli.commands.Board.prototype.getName = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.cc.arduino.cli.commands.Board} returns this
- */
-proto.cc.arduino.cli.commands.Board.prototype.setName = function(value) {
- return jspb.Message.setProto3StringField(this, 1, value);
-};
-
-
-/**
- * optional string fqbn = 2;
- * @return {string}
- */
-proto.cc.arduino.cli.commands.Board.prototype.getFqbn = function() {
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
-};
-
-
-/**
- * @param {string} value
- * @return {!proto.cc.arduino.cli.commands.Board} returns this
- */
-proto.cc.arduino.cli.commands.Board.prototype.setFqbn = function(value) {
- return jspb.Message.setProto3StringField(this, 2, value);
-};
-
-
goog.object.extend(exports, proto.cc.arduino.cli.commands);
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.d.ts
index 1c46ed59f..a87efcf6b 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.d.ts
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.d.ts
@@ -793,6 +793,9 @@ export class ZipLibraryInstallReq extends jspb.Message {
getPath(): string;
setPath(value: string): ZipLibraryInstallReq;
+ getOverwrite(): boolean;
+ setOverwrite(value: boolean): ZipLibraryInstallReq;
+
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ZipLibraryInstallReq.AsObject;
@@ -808,6 +811,7 @@ export namespace ZipLibraryInstallReq {
export type AsObject = {
instance?: commands_common_pb.Instance.AsObject,
path: string,
+ overwrite: boolean,
}
}
@@ -845,6 +849,9 @@ export class GitLibraryInstallReq extends jspb.Message {
getUrl(): string;
setUrl(value: string): GitLibraryInstallReq;
+ getOverwrite(): boolean;
+ setOverwrite(value: boolean): GitLibraryInstallReq;
+
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GitLibraryInstallReq.AsObject;
@@ -860,6 +867,7 @@ export namespace GitLibraryInstallReq {
export type AsObject = {
instance?: commands_common_pb.Instance.AsObject,
url: string,
+ overwrite: boolean,
}
}
diff --git a/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.js b/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.js
index 0dd8b03af..def3fb9cf 100644
--- a/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.js
+++ b/arduino-ide-extension/src/node/cli-protocol/commands/lib_pb.js
@@ -5878,7 +5878,8 @@ proto.cc.arduino.cli.commands.ZipLibraryInstallReq.prototype.toObject = function
proto.cc.arduino.cli.commands.ZipLibraryInstallReq.toObject = function(includeInstance, msg) {
var f, obj = {
instance: (f = msg.getInstance()) && commands_common_pb.Instance.toObject(includeInstance, f),
- path: jspb.Message.getFieldWithDefault(msg, 2, "")
+ path: jspb.Message.getFieldWithDefault(msg, 2, ""),
+ overwrite: jspb.Message.getBooleanFieldWithDefault(msg, 3, false)
};
if (includeInstance) {
@@ -5924,6 +5925,10 @@ proto.cc.arduino.cli.commands.ZipLibraryInstallReq.deserializeBinaryFromReader =
var value = /** @type {string} */ (reader.readString());
msg.setPath(value);
break;
+ case 3:
+ var value = /** @type {boolean} */ (reader.readBool());
+ msg.setOverwrite(value);
+ break;
default:
reader.skipField();
break;
@@ -5968,6 +5973,13 @@ proto.cc.arduino.cli.commands.ZipLibraryInstallReq.serializeBinaryToWriter = fun
f
);
}
+ f = message.getOverwrite();
+ if (f) {
+ writer.writeBool(
+ 3,
+ f
+ );
+ }
};
@@ -6026,6 +6038,24 @@ proto.cc.arduino.cli.commands.ZipLibraryInstallReq.prototype.setPath = function(
};
+/**
+ * optional bool overwrite = 3;
+ * @return {boolean}
+ */
+proto.cc.arduino.cli.commands.ZipLibraryInstallReq.prototype.getOverwrite = function() {
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
+};
+
+
+/**
+ * @param {boolean} value
+ * @return {!proto.cc.arduino.cli.commands.ZipLibraryInstallReq} returns this
+ */
+proto.cc.arduino.cli.commands.ZipLibraryInstallReq.prototype.setOverwrite = function(value) {
+ return jspb.Message.setProto3BooleanField(this, 3, value);
+};
+
+
@@ -6210,7 +6240,8 @@ proto.cc.arduino.cli.commands.GitLibraryInstallReq.prototype.toObject = function
proto.cc.arduino.cli.commands.GitLibraryInstallReq.toObject = function(includeInstance, msg) {
var f, obj = {
instance: (f = msg.getInstance()) && commands_common_pb.Instance.toObject(includeInstance, f),
- url: jspb.Message.getFieldWithDefault(msg, 2, "")
+ url: jspb.Message.getFieldWithDefault(msg, 2, ""),
+ overwrite: jspb.Message.getBooleanFieldWithDefault(msg, 3, false)
};
if (includeInstance) {
@@ -6256,6 +6287,10 @@ proto.cc.arduino.cli.commands.GitLibraryInstallReq.deserializeBinaryFromReader =
var value = /** @type {string} */ (reader.readString());
msg.setUrl(value);
break;
+ case 3:
+ var value = /** @type {boolean} */ (reader.readBool());
+ msg.setOverwrite(value);
+ break;
default:
reader.skipField();
break;
@@ -6300,6 +6335,13 @@ proto.cc.arduino.cli.commands.GitLibraryInstallReq.serializeBinaryToWriter = fun
f
);
}
+ f = message.getOverwrite();
+ if (f) {
+ writer.writeBool(
+ 3,
+ f
+ );
+ }
};
@@ -6358,6 +6400,24 @@ proto.cc.arduino.cli.commands.GitLibraryInstallReq.prototype.setUrl = function(v
};
+/**
+ * optional bool overwrite = 3;
+ * @return {boolean}
+ */
+proto.cc.arduino.cli.commands.GitLibraryInstallReq.prototype.getOverwrite = function() {
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
+};
+
+
+/**
+ * @param {boolean} value
+ * @return {!proto.cc.arduino.cli.commands.GitLibraryInstallReq} returns this
+ */
+proto.cc.arduino.cli.commands.GitLibraryInstallReq.prototype.setOverwrite = function(value) {
+ return jspb.Message.setProto3BooleanField(this, 3, value);
+};
+
+
diff --git a/arduino-ide-extension/src/node/core-client-provider.ts b/arduino-ide-extension/src/node/core-client-provider.ts
index 258d1ced5..7919ea9bf 100644
--- a/arduino-ide-extension/src/node/core-client-provider.ts
+++ b/arduino-ide-extension/src/node/core-client-provider.ts
@@ -54,7 +54,7 @@ export class CoreClientProvider extends GrpcClientProvider {
+ async builtIns(): Promise {
if (this._all) {
return this._all;
}
@@ -40,10 +40,10 @@ export class ExamplesServiceImpl implements ExamplesService {
}
// TODO: decide whether it makes sense to cache them. Keys should be: `fqbn` + version of containing core/library.
- async installed({ fqbn }: { fqbn: string }): Promise<{ user: ExampleContainer[], current: ExampleContainer[], any: ExampleContainer[] }> {
- const user: ExampleContainer[] = [];
- const current: ExampleContainer[] = [];
- const any: ExampleContainer[] = [];
+ async installed({ fqbn }: { fqbn: string }): Promise<{ user: SketchContainer[], current: SketchContainer[], any: SketchContainer[] }> {
+ const user: SketchContainer[] = [];
+ const current: SketchContainer[] = [];
+ const any: SketchContainer[] = [];
if (fqbn) {
const packages: LibraryPackage[] = await this.libraryService.list({ fqbn });
for (const pkg of packages) {
@@ -66,7 +66,7 @@ export class ExamplesServiceImpl implements ExamplesService {
* folder hierarchy. This method tries to workaround it by falling back to the `installDirUri` and manually creating the
* location of the examples. Otherwise it creates the example container from the direct examples FS paths.
*/
- protected async tryGroupExamples({ label, exampleUris, installDirUri }: LibraryPackage): Promise {
+ protected async tryGroupExamples({ label, exampleUris, installDirUri }: LibraryPackage): Promise {
const paths = exampleUris.map(uri => FileUri.fsPath(uri));
if (installDirUri) {
for (const example of ['example', 'Example', 'EXAMPLE', 'examples', 'Examples', 'EXAMPLES']) {
@@ -75,7 +75,7 @@ export class ExamplesServiceImpl implements ExamplesService {
const isDir = exists && (await promisify(fs.lstat)(examplesPath)).isDirectory();
if (isDir) {
const fileNames = await promisify(fs.readdir)(examplesPath);
- const children: ExampleContainer[] = [];
+ const children: SketchContainer[] = [];
const sketches: Sketch[] = [];
for (const fileName of fileNames) {
const subPath = join(examplesPath, fileName);
@@ -109,7 +109,7 @@ export class ExamplesServiceImpl implements ExamplesService {
}
// Built-ins are included inside the IDE.
- protected async load(path: string): Promise {
+ protected async load(path: string): Promise {
if (!await promisify(fs.exists)(path)) {
throw new Error('Examples are not available');
}
@@ -119,7 +119,7 @@ export class ExamplesServiceImpl implements ExamplesService {
}
const names = await promisify(fs.readdir)(path);
const sketches: Sketch[] = [];
- const children: ExampleContainer[] = [];
+ const children: SketchContainer[] = [];
for (const p of names.map(name => join(path, name))) {
const stat = await promisify(fs.stat)(p);
if (stat.isDirectory()) {
diff --git a/arduino-ide-extension/src/node/grpc-client-provider.ts b/arduino-ide-extension/src/node/grpc-client-provider.ts
index fd6fa2110..c87770090 100644
--- a/arduino-ide-extension/src/node/grpc-client-provider.ts
+++ b/arduino-ide-extension/src/node/grpc-client-provider.ts
@@ -59,7 +59,7 @@ export abstract class GrpcClientProvider {
const client = await this.createClient(this._port);
this._client = client;
} catch (error) {
- this.logger.error('Could create client for gRPC.', error)
+ this.logger.error('Could not create client for gRPC.', error)
}
}
}
diff --git a/arduino-ide-extension/src/node/library-service-server-impl.ts b/arduino-ide-extension/src/node/library-service-server-impl.ts
index da8a6f530..1946a750a 100644
--- a/arduino-ide-extension/src/node/library-service-server-impl.ts
+++ b/arduino-ide-extension/src/node/library-service-server-impl.ts
@@ -1,5 +1,4 @@
import { injectable, inject } from 'inversify';
-import * as path from 'path';
import { LibraryDependency, LibraryPackage, LibraryService } from '../common/protocol/library-service';
import { CoreClientAware } from './core-client-provider';
import {
@@ -183,7 +182,11 @@ export class LibraryServiceImpl extends CoreClientAware implements LibraryServic
});
await new Promise((resolve, reject) => {
resp.on('end', resolve);
- resp.on('error', reject);
+ resp.on('error', error => {
+ this.outputService.append({ chunk: `Failed to install library: ${item.name}${version ? `:${version}` : ''}.\n` });
+ this.outputService.append({ chunk: error.toString() });
+ reject(error);
+ });
});
const items = await this.search({});
@@ -192,12 +195,15 @@ export class LibraryServiceImpl extends CoreClientAware implements LibraryServic
console.info('<<< Library package installation done.', item);
}
- async installZip({ zipUri }: { zipUri: string }): Promise {
+ async installZip({ zipUri, overwrite }: { zipUri: string, overwrite?: boolean }): Promise {
const coreClient = await this.coreClient();
const { client, instance } = coreClient;
const req = new ZipLibraryInstallReq();
req.setPath(FileUri.fsPath(zipUri));
req.setInstance(instance);
+ if (typeof overwrite === 'boolean') {
+ req.setOverwrite(overwrite);
+ }
const resp = client.zipLibraryInstall(req);
resp.on('data', (r: ZipLibraryInstallResp) => {
const task = r.getTaskProgress();
@@ -207,19 +213,7 @@ export class LibraryServiceImpl extends CoreClientAware implements LibraryServic
});
await new Promise((resolve, reject) => {
resp.on('end', resolve);
- resp.on('error', error => {
- // This is a hack to have better error messages for the user. We try to get the name of the library from this:
- // Request installZip failed with error: 2 UNKNOWN: copying library: destination /path/to/lib already exists
- const match = error.message.match(/destination (.*?) already exists/);
- if (match && match.length >= 2) {
- const name = path.basename(match[1].trim());
- if (name) {
- reject(new Error(`A library named ${name} already exists.`));
- return;
- }
- }
- reject(error);
- });
+ resp.on('error', reject);
});
}
diff --git a/arduino-ide-extension/src/node/monitor/monitor-service-impl.ts b/arduino-ide-extension/src/node/monitor/monitor-service-impl.ts
index a62089e38..06e68cc0e 100644
--- a/arduino-ide-extension/src/node/monitor/monitor-service-impl.ts
+++ b/arduino-ide-extension/src/node/monitor/monitor-service-impl.ts
@@ -122,9 +122,9 @@ export class MonitorServiceImpl implements MonitorService {
if (!this.connection && reason && reason.code === MonitorError.ErrorCodes.CLIENT_CANCEL) {
return Status.OK;
}
- this.logger.info(`>>> Disposing monitor connection...`);
+ this.logger.info('>>> Disposing monitor connection...');
if (!this.connection) {
- this.logger.warn(`<<< Not connected. Nothing to dispose.`);
+ this.logger.warn('<<< Not connected. Nothing to dispose.');
return Status.NOT_CONNECTED;
}
const { duplex, config } = this.connection;
diff --git a/arduino-ide-extension/src/node/notification-service-server.ts b/arduino-ide-extension/src/node/notification-service-server.ts
index 6060ab7d2..a3ab27115 100644
--- a/arduino-ide-extension/src/node/notification-service-server.ts
+++ b/arduino-ide-extension/src/node/notification-service-server.ts
@@ -53,7 +53,7 @@ export class NotificationServiceServerImpl implements NotificationServiceServer
disposeClient(client: NotificationServiceClient): void {
const index = this.clients.indexOf(client);
if (index === -1) {
- console.warn(`Could not dispose notification service client. It was not registered.`);
+ console.warn('Could not dispose notification service client. It was not registered.');
return;
}
this.clients.splice(index, 1);
diff --git a/arduino-ide-extension/src/node/sketches-service-impl.ts b/arduino-ide-extension/src/node/sketches-service-impl.ts
index 48354cc2a..03eb0231e 100644
--- a/arduino-ide-extension/src/node/sketches-service-impl.ts
+++ b/arduino-ide-extension/src/node/sketches-service-impl.ts
@@ -1,19 +1,21 @@
import { injectable, inject } from 'inversify';
+import * as minimatch from 'minimatch';
import * as fs from 'fs';
import * as os from 'os';
import * as temp from 'temp';
import * as path from 'path';
+import * as crypto from 'crypto';
import { ncp } from 'ncp';
import { promisify } from 'util';
import URI from '@theia/core/lib/common/uri';
import { FileUri } from '@theia/core/lib/node';
import { isWindows } from '@theia/core/lib/common/os';
import { ConfigService } from '../common/protocol/config-service';
-import { SketchesService, Sketch } from '../common/protocol/sketches-service';
+import { SketchesService, Sketch, SketchContainer } from '../common/protocol/sketches-service';
import { firstToLowerCase } from '../common/utils';
import { NotificationServiceServerImpl } from './notification-service-server';
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
-import { CoreClientProvider } from './core-client-provider';
+import { CoreClientAware } from './core-client-provider';
import { LoadSketchReq, ArchiveSketchReq } from './cli-protocol/commands/commands_pb';
const WIN32_DRIVE_REGEXP = /^[a-zA-Z]:\\/;
@@ -21,21 +23,18 @@ const WIN32_DRIVE_REGEXP = /^[a-zA-Z]:\\/;
const prefix = '.arduinoIDE-unsaved';
@injectable()
-export class SketchesServiceImpl implements SketchesService {
+export class SketchesServiceImpl extends CoreClientAware implements SketchesService {
@inject(ConfigService)
protected readonly configService: ConfigService;
- @inject(CoreClientProvider)
- protected readonly coreClientProvider: CoreClientProvider;
-
@inject(NotificationServiceServerImpl)
protected readonly notificationService: NotificationServiceServerImpl;
@inject(EnvVariablesServer)
protected readonly envVariableServer: EnvVariablesServer;
-
- async getSketches(uri?: string): Promise {
+ async getSketches({ uri, exclude }: { uri?: string, exclude?: string[] }): Promise {
+ const start = Date.now();
let sketchbookPath: undefined | string;
if (!uri) {
const { sketchDirUri } = await this.configService.getConfiguration();
@@ -46,33 +45,65 @@ export class SketchesServiceImpl implements SketchesService {
} else {
sketchbookPath = FileUri.fsPath(uri);
}
+ const container: SketchContainerWithDetails = {
+ label: uri ? path.basename(sketchbookPath) : 'Sketchbook',
+ sketches: [],
+ children: []
+ };
if (!await promisify(fs.exists)(sketchbookPath)) {
- return [];
+ return container;
}
const stat = await promisify(fs.stat)(sketchbookPath);
if (!stat.isDirectory()) {
- return [];
+ return container;
}
- const sketches: Array = [];
- const filenames = await promisify(fs.readdir)(sketchbookPath);
- for (const fileName of filenames) {
- const filePath = path.join(sketchbookPath, fileName);
- const sketch = await this._isSketchFolder(FileUri.create(filePath).toString());
- if (sketch) {
+ const recursivelyLoad = async (fsPath: string, containerToLoad: SketchContainerWithDetails) => {
+ const filenames = await promisify(fs.readdir)(fsPath);
+ for (const name of filenames) {
+ const childFsPath = path.join(fsPath, name);
+ let skip = false;
+ for (const pattern of exclude || ['**/libraries/**', '**/hardware/**']) {
+ if (!skip && minimatch(childFsPath, pattern)) {
+ skip = true;
+ }
+ }
+ if (skip) {
+ continue;
+ }
try {
- const stat = await promisify(fs.stat)(filePath);
- sketches.push({
- ...sketch,
- mtimeMs: stat.mtimeMs
- });
+ const stat = await promisify(fs.stat)(childFsPath);
+ if (stat.isDirectory()) {
+ const sketch = await this._isSketchFolder(FileUri.create(childFsPath).toString());
+ if (sketch) {
+ containerToLoad.sketches.push({
+ ...sketch,
+ mtimeMs: stat.mtimeMs
+ });
+ } else {
+ const childContainer: SketchContainerWithDetails = {
+ label: name,
+ children: [],
+ sketches: []
+ };
+ await recursivelyLoad(childFsPath, childContainer);
+ if (!SketchContainer.isEmpty(childContainer)) {
+ containerToLoad.children.push(childContainer);
+ }
+ }
+ }
} catch {
- console.warn(`Could not load sketch from ${filePath}.`);
+ console.warn(`Could not load sketch from ${childFsPath}.`);
}
}
+ containerToLoad.sketches.sort((left, right) => right.mtimeMs - left.mtimeMs);
+ return containerToLoad;
}
- sketches.sort((left, right) => right.mtimeMs - left.mtimeMs);
- return sketches;
+
+ await recursivelyLoad(sketchbookPath, container);
+ SketchContainer.prune(container);
+ console.debug(`Loading the sketches from ${sketchbookPath} took ${Date.now() - start} ms.`);
+ return container;
}
async loadSketch(uri: string): Promise {
@@ -301,27 +332,47 @@ void loop() {
await this.loadSketch(sketch.uri); // Sanity check.
return sketch.uri;
}
+
+ const copy = async (sourcePath: string, destinationPath: string) => {
+ return new Promise((resolve, reject) => {
+ ncp.ncp(sourcePath, destinationPath, async error => {
+ if (error) {
+ reject(error);
+ return;
+ }
+ const newName = path.basename(destinationPath);
+ try {
+ const oldPath = path.join(destinationPath, new URI(sketch.mainFileUri).path.base);
+ const newPath = path.join(destinationPath, `${newName}.ino`);
+ if (oldPath !== newPath) {
+ await promisify(fs.rename)(oldPath, newPath);
+ }
+ await this.loadSketch(FileUri.create(destinationPath).toString()); // Sanity check.
+ resolve();
+ } catch (e) {
+ reject(e);
+ }
+ });
+ });
+ }
+ // https://github.com/arduino/arduino-ide/issues/65
+ // When copying `/path/to/sketchbook/sketch_A` to `/path/to/sketchbook/sketch_A/anything` on a non-POSIX filesystem,
+ // `ncp` makes a recursion and copies the folders over and over again. In such cases, we copy the source into a temp folder,
+ // then move it to the desired destination.
const destination = FileUri.fsPath(destinationUri);
- await new Promise((resolve, reject) => {
- ncp.ncp(source, destination, async error => {
- if (error) {
- reject(error);
+ let tempDestination = await new Promise((resolve, reject) => {
+ temp.track().mkdir({ prefix }, async (err, dirPath) => {
+ if (err) {
+ reject(err);
return;
}
- const newName = path.basename(destination);
- try {
- const oldPath = path.join(destination, new URI(sketch.mainFileUri).path.base);
- const newPath = path.join(destination, `${newName}.ino`);
- if (oldPath !== newPath) {
- await promisify(fs.rename)(oldPath, newPath);
- }
- await this.loadSketch(destinationUri); // Sanity check.
- resolve();
- } catch (e) {
- reject(e);
- }
+ resolve(dirPath);
});
});
+ tempDestination = path.join(tempDestination, sketch.name);
+ await fs.promises.mkdir(tempDestination, { recursive: true });
+ await copy(source, tempDestination);
+ await copy(tempDestination, destination);
return FileUri.create(destination).toString();
}
@@ -348,23 +399,16 @@ void loop() {
return destinationUri;
}
- private async coreClient(): Promise {
- const coreClient = await new Promise(async resolve => {
- const client = await this.coreClientProvider.client();
- if (client) {
- resolve(client);
- return;
- }
- const toDispose = this.coreClientProvider.onClientReady(async () => {
- const client = await this.coreClientProvider.client();
- if (client) {
- toDispose.dispose();
- resolve(client);
- return;
- }
- });
- });
- return coreClient;
+ async getIdeTempFolderUri(sketch: Sketch): Promise {
+ const genBuildPath = await this.getIdeTempFolderPath(sketch);
+ return FileUri.create(genBuildPath).toString();
+ }
+
+ async getIdeTempFolderPath(sketch: Sketch): Promise {
+ const sketchPath = FileUri.fsPath(sketch.uri);
+ await fs.promises.readdir(sketchPath); // Validates the sketch folder and rejects if not accessible.
+ const suffix = crypto.createHash('md5').update(sketchPath).digest('hex');
+ return path.join(os.tmpdir(), `arduino-ide2-${suffix}`);
}
}
@@ -372,3 +416,8 @@ void loop() {
interface SketchWithDetails extends Sketch {
readonly mtimeMs: number;
}
+interface SketchContainerWithDetails extends SketchContainer {
+ readonly label: string;
+ readonly children: SketchContainerWithDetails[];
+ readonly sketches: SketchWithDetails[];
+}
diff --git a/arduino-ide-extension/tslint.json b/arduino-ide-extension/tslint.json
index 9e8ab4d7c..d850adc6c 100644
--- a/arduino-ide-extension/tslint.json
+++ b/arduino-ide-extension/tslint.json
@@ -15,6 +15,7 @@
"check-else",
"check-whitespace"
],
+ "quotemark": [true, "single", "jsx-single", "avoid-escape", "avoid-template"],
"radix": true,
"trailing-comma": [false],
"triple-equals": [true, "allow-null-check"],
@@ -34,4 +35,4 @@
"check-type"
]
}
-}
\ No newline at end of file
+}
diff --git a/browser-app/package.json b/browser-app/package.json
index 1d26f53a7..010d9df2a 100644
--- a/browser-app/package.json
+++ b/browser-app/package.json
@@ -1,8 +1,8 @@
{
"private": true,
"name": "browser-app",
- "version": "2.0.0-beta.3",
- "license": "MIT",
+ "version": "2.0.0-beta.4",
+ "license": "AGPL-3.0-or-later",
"dependencies": {
"@theia/core": "next",
"@theia/debug": "next",
@@ -18,7 +18,7 @@
"@theia/process": "next",
"@theia/terminal": "next",
"@theia/workspace": "next",
- "arduino-ide-extension": "2.0.0-beta.3"
+ "arduino-ide-extension": "2.0.0-beta.4"
},
"devDependencies": {
"@theia/cli": "next"
@@ -37,7 +37,12 @@
"editor.autoSave": "on",
"editor.minimap.enabled": false,
"editor.tabSize": 2,
- "editor.scrollBeyondLastLine": false
+ "editor.scrollBeyondLastLine": false,
+ "editor.quickSuggestions": {
+ "other": false,
+ "comments": false,
+ "strings": false
+ }
}
}
},
diff --git a/electron-app/package.json b/electron-app/package.json
index 0dd9a2879..ffe0fee49 100644
--- a/electron-app/package.json
+++ b/electron-app/package.json
@@ -1,8 +1,8 @@
{
"private": true,
"name": "electron-app",
- "version": "2.0.0-beta.3",
- "license": "MIT",
+ "version": "2.0.0-beta.4",
+ "license": "AGPL-3.0-or-later",
"main": "src-gen/frontend/electron-main.js",
"dependencies": {
"@theia/core": "next",
@@ -20,7 +20,7 @@
"@theia/process": "next",
"@theia/terminal": "next",
"@theia/workspace": "next",
- "arduino-ide-extension": "2.0.0-beta.3"
+ "arduino-ide-extension": "2.0.0-beta.4"
},
"devDependencies": {
"@theia/cli": "next"
@@ -40,7 +40,12 @@
"editor.autoSave": "on",
"editor.minimap.enabled": false,
"editor.tabSize": 2,
- "editor.scrollBeyondLastLine": false
+ "editor.scrollBeyondLastLine": false,
+ "editor.quickSuggestions": {
+ "other": false,
+ "comments": false,
+ "strings": false
+ }
}
}
},
diff --git a/electron/build/scripts/notarize.js b/electron/build/scripts/notarize.js
index 98ed04f99..b297f867a 100644
--- a/electron/build/scripts/notarize.js
+++ b/electron/build/scripts/notarize.js
@@ -6,6 +6,10 @@ exports.default = async function notarizing(context) {
console.log('Skipping notarization: not on CI.');
return;
}
+ if (process.env.IS_FORK === 'true') {
+ console.log('Skipping the app notarization: building from a fork.');
+ return;
+ }
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== 'darwin') {
return;
diff --git a/electron/build/template-package.json b/electron/build/template-package.json
index 27cca42a6..b5a41d5f7 100644
--- a/electron/build/template-package.json
+++ b/electron/build/template-package.json
@@ -137,7 +137,7 @@
"theiaPluginsDir": "plugins",
"theiaPlugins": {
"vscode-builtin-cpp": "https://open-vsx.org/api/vscode/cpp/1.52.1/file/vscode.cpp-1.52.1.vsix",
- "vscode-arduino-language-server": "https://downloads.arduino.cc/vscode-arduino-language-server/nightly/vscode-arduino-language-server-0.0.1.vsix",
+ "vscode-arduino-tools": "https://downloads.arduino.cc/vscode-arduino-tools/nightly/vscode-arduino-tools-0.0.1-beta.1.vsix",
"vscode-builtin-json": "https://open-vsx.org/api/vscode/json/1.46.1/file/vscode.json-1.46.1.vsix",
"vscode-builtin-json-language-features": "https://open-vsx.org/api/vscode/json-language-features/1.46.1/file/vscode.json-language-features-1.46.1.vsix",
"cortex-debug": "https://open-vsx.org/api/marus25/cortex-debug/0.3.7/file/marus25.cortex-debug-0.3.7.vsix"
diff --git a/electron/packager/package.json b/electron/packager/package.json
index c987f619a..8ce652c5e 100644
--- a/electron/packager/package.json
+++ b/electron/packager/package.json
@@ -11,7 +11,7 @@
},
"keywords": [],
"author": "Arduino SA",
- "license": "MIT",
+ "license": "AGPL-3.0-or-later",
"dependencies": {
"@types/file-type": "^10.9.1",
"@types/temp": "^0.8.32",
diff --git a/package.json b/package.json
index 326ddd8b9..e5693b1cb 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,10 @@
{
"name": "arduino-editor",
- "version": "2.0.0-beta.3",
+ "version": "2.0.0-beta.4",
"description": "Arduino IDE",
"repository": "https://github.com/bcmi-labs/arduino-editor.git",
"author": "Arduino SA",
- "license": "MIT",
+ "license": "AGPL-3.0-or-later",
"private": true,
"engines": {
"node": ">=12.14.1 <13"
@@ -36,7 +36,7 @@
"theiaPluginsDir": "plugins",
"theiaPlugins": {
"vscode-builtin-cpp": "https://open-vsx.org/api/vscode/cpp/1.52.1/file/vscode.cpp-1.52.1.vsix",
- "vscode-arduino-language-server": "https://downloads.arduino.cc/vscode-arduino-language-server/nightly/vscode-arduino-language-server-0.0.1.vsix",
+ "vscode-arduino-tools": "https://downloads.arduino.cc/vscode-arduino-tools/nightly/vscode-arduino-tools-0.0.1-beta.1.vsix",
"vscode-builtin-json": "https://open-vsx.org/api/vscode/json/1.46.1/file/vscode.json-1.46.1.vsix",
"vscode-builtin-json-language-features": "https://open-vsx.org/api/vscode/json-language-features/1.46.1/file/vscode.json-language-features-1.46.1.vsix",
"cortex-debug": "https://open-vsx.org/api/marus25/cortex-debug/0.3.7/file/marus25.cortex-debug-0.3.7.vsix"
diff --git a/static/download_01.gif b/static/download_01.gif
deleted file mode 100644
index 393288d28..000000000
Binary files a/static/download_01.gif and /dev/null differ
diff --git a/static/download_02.gif b/static/download_02.gif
deleted file mode 100644
index 1abc953f4..000000000
Binary files a/static/download_02.gif and /dev/null differ
diff --git a/static/screenshot.png b/static/screenshot.png
new file mode 100644
index 000000000..254f4373f
Binary files /dev/null and b/static/screenshot.png differ