From 74b6d04a570b848d27fb57a0eb79b55395baa9eb Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Wed, 8 Nov 2023 12:04:44 +0100 Subject: [PATCH 1/6] feat: use new `debug -I -P` CLI output - Can pick a programmer if missing, - Can auto-select a programmer on app start, - Can edit the `launch.json`, Signed-off-by: Akos Kitta --- .eslintrc.js | 2 +- .../browser/arduino-ide-frontend-module.ts | 4 + .../src/browser/boards/boards-data-store.ts | 40 ++-- .../contributions/auto-select-programmer.ts | 119 ++++++++++++ .../src/browser/contributions/debug.ts | 167 ++++++++++++----- .../src/browser/contributions/ino-language.ts | 114 +++++++++--- .../contributions/select-programmer.ts | 87 +++++++++ .../browser/sketches-service-client-impl.ts | 31 +++- .../debug/debug-configuration-manager.ts | 53 ++++-- .../theia/monaco/monaco-editor-provider.ts | 38 +++- .../theia/monaco/monaco-text-model-service.ts | 2 +- arduino-ide-extension/src/common/nls.ts | 4 + .../src/common/protocol/boards-service.ts | 15 ++ .../src/common/protocol/sketches-service.ts | 2 +- .../src/node/sketches-service-impl.ts | 4 +- .../node/theia/plugin-ext/plugin-reader.ts | 31 +++- .../browser/auto-select-programmer.test.ts | 172 ++++++++++++++++++ electron-app/package.json | 2 +- i18n/en.json | 4 + 19 files changed, 768 insertions(+), 123 deletions(-) create mode 100644 arduino-ide-extension/src/browser/contributions/auto-select-programmer.ts create mode 100644 arduino-ide-extension/src/browser/contributions/select-programmer.ts create mode 100644 arduino-ide-extension/src/test/browser/auto-select-programmer.test.ts diff --git a/.eslintrc.js b/.eslintrc.js index da16cbb76..4bb67da9e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -18,7 +18,7 @@ module.exports = { 'electron-app/src-gen/*', 'electron-app/gen-webpack*.js', '!electron-app/webpack.config.js', - 'plugins/*', + 'electron-app/plugins/*', 'arduino-ide-extension/src/node/cli-protocol', '**/lib/*', ], diff --git a/arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts b/arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts index 436dd8e86..234b7a828 100644 --- a/arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts +++ b/arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts @@ -361,6 +361,8 @@ import { TerminalFrontendContribution as TheiaTerminalFrontendContribution } fro import { SelectionService } from '@theia/core/lib/common/selection-service'; import { CommandService } from '@theia/core/lib/common/command'; import { CorePreferences } from '@theia/core/lib/browser/core-preferences'; +import { SelectProgrammer } from './contributions/select-programmer'; +import { AutoSelectProgrammer } from './contributions/auto-select-programmer'; // Hack to fix copy/cut/paste issue after electron version update in Theia. // https://github.com/eclipse-theia/theia/issues/12487 @@ -753,6 +755,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => { Contribution.configure(bind, CreateCloudCopy); Contribution.configure(bind, UpdateArduinoState); Contribution.configure(bind, BoardsDataMenuUpdater); + Contribution.configure(bind, SelectProgrammer); + Contribution.configure(bind, AutoSelectProgrammer); bindContributionProvider(bind, StartupTaskProvider); bind(StartupTaskProvider).toService(BoardsServiceProvider); // to reuse the boards config in another window diff --git a/arduino-ide-extension/src/browser/boards/boards-data-store.ts b/arduino-ide-extension/src/browser/boards/boards-data-store.ts index 579f30b7a..70683763a 100644 --- a/arduino-ide-extension/src/browser/boards/boards-data-store.ts +++ b/arduino-ide-extension/src/browser/boards/boards-data-store.ts @@ -4,12 +4,15 @@ import { DisposableCollection } from '@theia/core/lib/common/disposable'; import { Emitter, Event } from '@theia/core/lib/common/event'; import { ILogger } from '@theia/core/lib/common/logger'; import { deepClone } from '@theia/core/lib/common/objects'; +import type { Mutable } from '@theia/core/lib/common/types'; import { inject, injectable, named } from '@theia/core/shared/inversify'; import { BoardDetails, BoardsService, ConfigOption, + ConfigValue, Programmer, + isProgrammer, } from '../../common/protocol'; import { notEmpty } from '../../common/utils'; import { NotificationCenter } from '../notification-center'; @@ -43,7 +46,7 @@ export class BoardsDataStore implements FrontendApplicationContribution { const key = this.getStorageKey(fqbn); let data = await this.storageService.getData(key); if (!data || !data.length) { - const details = await this.getBoardDetailsSafe(fqbn); + const details = await this.loadBoardDetails(fqbn); if (details) { data = details.configOptions; if (data.length) { @@ -91,7 +94,7 @@ export class BoardsDataStore implements FrontendApplicationContribution { return data; } - const boardDetails = await this.getBoardDetailsSafe(fqbn); + const boardDetails = await this.loadBoardDetails(fqbn); if (!boardDetails) { return BoardsDataStore.Data.EMPTY; } @@ -99,6 +102,7 @@ export class BoardsDataStore implements FrontendApplicationContribution { data = { configOptions: boardDetails.configOptions, programmers: boardDetails.programmers, + selectedProgrammer: boardDetails.programmers.find((p) => p.default), }; await this.storageService.setData(key, data); return data; @@ -142,11 +146,12 @@ export class BoardsDataStore implements FrontendApplicationContribution { } let updated = false; for (const value of configOption.values) { - if (value.value === selectedValue) { - (value as any).selected = true; + const mutable: Mutable = value; + if (mutable.value === selectedValue) { + mutable.selected = true; updated = true; } else { - (value as any).selected = false; + mutable.selected = false; } } if (!updated) { @@ -172,9 +177,7 @@ export class BoardsDataStore implements FrontendApplicationContribution { return `.arduinoIDE-configOptions-${fqbn}`; } - protected async getBoardDetailsSafe( - fqbn: string - ): Promise { + async loadBoardDetails(fqbn: string): Promise { try { const details = this.boardsService.getBoardDetails({ fqbn }); return details; @@ -213,14 +216,23 @@ export namespace BoardsDataStore { configOptions: [], programmers: [], }; - export function is(arg: any): arg is Data { + export function is(arg: unknown): arg is Data { return ( - !!arg && - 'configOptions' in arg && - Array.isArray(arg['configOptions']) && - 'programmers' in arg && - Array.isArray(arg['programmers']) + typeof arg === 'object' && + arg !== null && + Array.isArray((arg).configOptions) && + Array.isArray((arg).programmers) && + ((arg).selectedProgrammer === undefined || + isProgrammer((arg).selectedProgrammer)) ); } } } + +export function isEmptyData(data: BoardsDataStore.Data): boolean { + return ( + Boolean(!data.configOptions.length) && + Boolean(!data.programmers.length) && + Boolean(!data.selectedProgrammer) + ); +} diff --git a/arduino-ide-extension/src/browser/contributions/auto-select-programmer.ts b/arduino-ide-extension/src/browser/contributions/auto-select-programmer.ts new file mode 100644 index 000000000..2805b523f --- /dev/null +++ b/arduino-ide-extension/src/browser/contributions/auto-select-programmer.ts @@ -0,0 +1,119 @@ +import type { MaybePromise } from '@theia/core/lib/common/types'; +import { inject, injectable } from '@theia/core/shared/inversify'; +import { + BoardDetails, + Programmer, + isBoardIdentifierChangeEvent, +} from '../../common/protocol'; +import { BoardsDataStore, isEmptyData } from '../boards/boards-data-store'; +import { BoardsServiceProvider } from '../boards/boards-service-provider'; +import { Contribution } from './contribution'; + +/** + * Before CLI 0.35.0-rc.3, there was no `programmer#default` property in the `board details` response. + * This method does the programmer migration in the data store. If there is a programmer selected, it's a noop. + * If no programmer is selected, it forcefully reloads the details from the CLI and updates it in the local storage. + */ +@injectable() +export class AutoSelectProgrammer extends Contribution { + @inject(BoardsServiceProvider) + private readonly boardsServiceProvider: BoardsServiceProvider; + @inject(BoardsDataStore) + private readonly boardsDataStore: BoardsDataStore; + + override onStart(): void { + this.boardsServiceProvider.onBoardsConfigDidChange((event) => { + if (isBoardIdentifierChangeEvent(event)) { + this.ensureProgrammerIsSelected(); + } + }); + } + + override onReady(): void { + this.boardsServiceProvider.ready.then(() => + this.ensureProgrammerIsSelected() + ); + } + + private async ensureProgrammerIsSelected(): Promise { + return ensureProgrammerIsSelected({ + fqbn: this.boardsServiceProvider.boardsConfig.selectedBoard?.fqbn, + getData: (fqbn) => this.boardsDataStore.getData(fqbn), + loadBoardDetails: (fqbn) => this.boardsDataStore.loadBoardDetails(fqbn), + selectProgrammer: (arg) => this.boardsDataStore.selectProgrammer(arg), + }); + } +} + +interface EnsureProgrammerIsSelectedParams { + fqbn: string | undefined; + getData: (fqbn: string | undefined) => MaybePromise; + loadBoardDetails: (fqbn: string) => MaybePromise; + selectProgrammer(options: { + fqbn: string; + selectedProgrammer: Programmer; + }): MaybePromise; +} + +export async function ensureProgrammerIsSelected( + params: EnsureProgrammerIsSelectedParams +): Promise { + const { fqbn, getData, loadBoardDetails, selectProgrammer } = params; + if (!fqbn) { + return false; + } + console.debug(`Ensuring a programmer is selected for ${fqbn}...`); + const data = await getData(fqbn); + if (isEmptyData(data)) { + // For example, the platform is not installed. + console.debug(`Skipping. No boards data is available for ${fqbn}.`); + return false; + } + if (data.selectedProgrammer) { + console.debug( + `A programmer is already selected for ${fqbn}: '${data.selectedProgrammer.id}'.` + ); + return true; + } + let programmer = data.programmers.find((p) => p.default); + if (programmer) { + // select the programmer if the default info is available + const result = await selectProgrammer({ + fqbn, + selectedProgrammer: programmer, + }); + if (result) { + console.debug(`Selected '${programmer.id}' programmer for ${fqbn}.`); + return result; + } + } + console.debug(`Reloading board details for ${fqbn}...`); + const reloadedData = await loadBoardDetails(fqbn); + if (!reloadedData) { + console.debug(`Skipping. No board details found for ${fqbn}.`); + return false; + } + if (!reloadedData.programmers.length) { + console.debug(`Skipping. ${fqbn} does not have programmers.`); + return false; + } + programmer = reloadedData.programmers.find((p) => p.default); + if (!programmer) { + console.debug( + `Skipping. Could not find a default programmer for ${fqbn}. Programmers were: ` + ); + return false; + } + const result = await selectProgrammer({ + fqbn, + selectedProgrammer: programmer, + }); + if (result) { + console.debug(`Selected '${programmer.id}' programmer for ${fqbn}.`); + } else { + console.debug( + `Could not select '${programmer.id}' programmer for ${fqbn}.` + ); + } + return result; +} diff --git a/arduino-ide-extension/src/browser/contributions/debug.ts b/arduino-ide-extension/src/browser/contributions/debug.ts index 5dec4655c..dce37f4f0 100644 --- a/arduino-ide-extension/src/browser/contributions/debug.ts +++ b/arduino-ide-extension/src/browser/contributions/debug.ts @@ -1,46 +1,81 @@ +import { Emitter, Event } from '@theia/core/lib/common/event'; +import { MenuModelRegistry } from '@theia/core/lib/common/menu/menu-model-registry'; +import { nls } from '@theia/core/lib/common/nls'; import { inject, injectable } from '@theia/core/shared/inversify'; -import { Event, Emitter } from '@theia/core/lib/common/event'; import { HostedPluginSupport } from '@theia/plugin-ext/lib/hosted/browser/hosted-plugin'; -import { ArduinoToolbar } from '../toolbar/arduino-toolbar'; -import { NotificationCenter } from '../notification-center'; +import { SelectManually } from '../../common/nls'; import { Board, BoardIdentifier, BoardsService, ExecutableService, + SketchRef, isBoardIdentifierChangeEvent, - Sketch, + isProgrammer, } from '../../common/protocol'; +import { BoardsDataStore } from '../boards/boards-data-store'; import { BoardsServiceProvider } from '../boards/boards-service-provider'; +import { ArduinoMenus } from '../menu/arduino-menus'; +import { NotificationCenter } from '../notification-center'; +import { CurrentSketch } from '../sketches-service-client-impl'; +import { ArduinoToolbar } from '../toolbar/arduino-toolbar'; import { - URI, Command, CommandRegistry, SketchContribution, TabBarToolbarRegistry, + URI, } from './contribution'; -import { MenuModelRegistry, nls } from '@theia/core/lib/common'; -import { CurrentSketch } from '../sketches-service-client-impl'; -import { ArduinoMenus } from '../menu/arduino-menus'; const COMPILE_FOR_DEBUG_KEY = 'arduino-compile-for-debug'; +interface StartDebugParams { + /** + * Absolute filesystem path to the Arduino CLI executable. + */ + readonly cliPath: string; + /** + * The the board to debug. + */ + readonly board: Readonly<{ fqbn: string; name?: string }>; + /** + * Absolute filesystem path of the sketch to debug. + */ + readonly sketchPath: string; + /** + * Location where the `launch.json` will be created on the fly before starting every debug session. + * If not defined, it falls back to `sketchPath/.vscode/launch.json`. + */ + readonly launchConfigsDirPath?: string; + /** + * Absolute path to the `arduino-cli.yaml` file. If not specified, it falls back to `~/.arduinoIDE/arduino-cli.yaml`. + */ + readonly cliConfigPath?: string; + /** + * Programmer for the debugging. + */ + readonly programmer?: string; + /** + * Custom progress title to use when getting the debug information from the CLI. + */ + readonly title?: string; +} +type StartDebugResult = boolean; + @injectable() export class Debug extends SketchContribution { @inject(HostedPluginSupport) private readonly hostedPluginSupport: HostedPluginSupport; - @inject(NotificationCenter) private readonly notificationCenter: NotificationCenter; - @inject(ExecutableService) private readonly executableService: ExecutableService; - @inject(BoardsService) private readonly boardService: BoardsService; - @inject(BoardsServiceProvider) private readonly boardsServiceProvider: BoardsServiceProvider; + @inject(BoardsDataStore) + private readonly boardsDataStore: BoardsDataStore; /** * If `undefined`, debugging is enabled. Otherwise, the reason why it's disabled. @@ -175,44 +210,37 @@ export class Debug extends SketchContribution { private async startDebug( board: BoardIdentifier | undefined = this.boardsServiceProvider.boardsConfig .selectedBoard - ): Promise { - if (!board) { - return; - } - const { name, fqbn } = board; - if (!fqbn) { - return; + ): Promise { + const params = await this.createStartDebugParams(board); + if (!params) { + return false; } await this.hostedPluginSupport.didStart; - const [sketch, executables] = await Promise.all([ - this.sketchServiceClient.currentSketch(), - this.executableService.list(), - ]); - if (!CurrentSketch.isValid(sketch)) { - return; - } - const ideTempFolderUri = await this.sketchesService.getIdeTempFolderUri( - sketch - ); - const [cliPath, sketchPath, configPath] = await Promise.all([ - this.fileService.fsPath(new URI(executables.cliUri)), - this.fileService.fsPath(new URI(sketch.uri)), - this.fileService.fsPath(new URI(ideTempFolderUri)), - ]); - const config = { - cliPath, - board: { - fqbn, - name, - }, - sketchPath, - configPath, - }; try { - await this.commandService.executeCommand('arduino.debug.start', config); + const result = await this.debug(params); + return Boolean(result); } catch (err) { - if (await this.isSketchNotVerifiedError(err, sketch)) { - const yes = nls.localize('vscode/extensionsUtils/yes', 'Yes'); + const yes = nls.localize('vscode/extensionsUtils/yes', 'Yes'); + const sketchUri = await this.fileSystemExt.getUri(params.sketchPath); + const sketch = SketchRef.fromUri(sketchUri); + if (err instanceof Error && /missing programmer/gi.test(err.message)) { + const answer = await this.messageService.warn( + nls.localize( + 'arduino/debug/programmerNotSelected', + 'The debugger requires a programmer. Do you want to select a programmer? You can select it manually from the Tools > Programmer menu.' + ), + SelectManually, + yes + ); + if (answer === yes) { + const result = await this.commandService.executeCommand( + 'arduino-select-programmer' + ); + if (isProgrammer(result)) { + return this.startDebug(); + } + } + } else if (await this.isSketchNotVerifiedError(err, sketch)) { const answer = await this.messageService.error( nls.localize( 'arduino/debug/sketchIsNotCompiled', @@ -230,6 +258,16 @@ export class Debug extends SketchContribution { ); } } + return false; + } + + private async debug( + params: StartDebugParams + ): Promise { + return this.commandService.executeCommand( + 'arduino.debug.start', + params + ); } get compileForDebug(): boolean { @@ -246,7 +284,7 @@ export class Debug extends SketchContribution { private async isSketchNotVerifiedError( err: unknown, - sketch: Sketch + sketch: SketchRef ): Promise { if (err instanceof Error) { try { @@ -260,6 +298,41 @@ export class Debug extends SketchContribution { } return false; } + + private async createStartDebugParams( + board: BoardIdentifier | undefined + ): Promise { + if (!board || !board.fqbn) { + return undefined; + } + const [sketch, executables, boardsData] = await Promise.all([ + this.sketchServiceClient.currentSketch(), + this.executableService.list(), + this.boardsDataStore.getData(board.fqbn), + ]); + if (!CurrentSketch.isValid(sketch)) { + return; + } + const ideTempFolderUri = await this.sketchesService.getIdeTempFolderUri( + sketch + ); + const [cliPath, sketchPath, launchConfigsDirPath] = await Promise.all([ + this.fileService.fsPath(new URI(executables.cliUri)), + this.fileService.fsPath(new URI(sketch.uri)), + this.fileService.fsPath(new URI(ideTempFolderUri)), + ]); + return { + board: { fqbn: board.fqbn, name: board.name }, + cliPath, + sketchPath, + launchConfigsDirPath, + programmer: boardsData.selectedProgrammer?.id, + title: nls.localize( + 'arduino/debug/getDebugInfo', + 'Getting debug info...' + ), + }; + } } export namespace Debug { export namespace Commands { diff --git a/arduino-ide-extension/src/browser/contributions/ino-language.ts b/arduino-ide-extension/src/browser/contributions/ino-language.ts index 096c27ed8..e434f6cb7 100644 --- a/arduino-ide-extension/src/browser/contributions/ino-language.ts +++ b/arduino-ide-extension/src/browser/contributions/ino-language.ts @@ -20,26 +20,83 @@ import { NotificationCenter } from '../notification-center'; import { SketchContribution, URI } from './contribution'; import { BoardsDataStore } from '../boards/boards-data-store'; +interface DaemonAddress { + /** + * The host where the Arduino CLI daemon is available. + */ + readonly hostname: string; + /** + * The port where the Arduino CLI daemon is listening. + */ + readonly port: number; + /** + * The [id](https://arduino.github.io/arduino-cli/latest/rpc/commands/#instance) of the initialized core Arduino client instance. + */ + readonly instance: number; +} + +interface StartLanguageServerParams { + /** + * Absolute filesystem path to the Arduino Language Server executable. + */ + readonly lsPath: string; + /** + * The hostname and the port for the gRPC channel connecting to the Arduino CLI daemon. + * The `instance` number is for the initialized core Arduino client. + */ + readonly daemonAddress: DaemonAddress; + /** + * Absolute filesystem path to [`clangd`](https://clangd.llvm.org/). + */ + readonly clangdPath: string; + /** + * The board is relevant to start a specific "flavor" of the language. + */ + readonly board: { fqbn: string; name?: string }; + /** + * `true` if the LS should generate the log files into the default location. The default location is the `cwd` of the process. + * It's very often the same as the workspace root of the IDE, aka the sketch folder. + * When it is a string, it is the absolute filesystem path to the folder to generate the log files. + * If `string`, but the path is inaccessible, the log files will be generated into the default location. + */ + readonly log?: boolean | string; + /** + * Optional `env` for the language server process. + */ + readonly env?: NodeJS.ProcessEnv; + /** + * Additional flags for the Arduino Language server process. + */ + readonly flags?: readonly string[]; + /** + * Set to `true`, to enable `Diagnostics`. + */ + readonly realTimeDiagnostics?: boolean; + /** + * If `true`, the logging is not forwarded to the _Output_ view via the language client. + */ + readonly silentOutput?: boolean; +} + +/** + * The FQBN the language server runs with or `undefined` if it could not start. + */ +type StartLanguageServerResult = string | undefined; + @injectable() export class InoLanguage extends SketchContribution { @inject(HostedPluginEvents) private readonly hostedPluginEvents: HostedPluginEvents; - @inject(ExecutableService) private readonly executableService: ExecutableService; - @inject(ArduinoDaemon) private readonly daemon: ArduinoDaemon; - @inject(BoardsService) private readonly boardsService: BoardsService; - @inject(BoardsServiceProvider) private readonly boardsServiceProvider: BoardsServiceProvider; - @inject(NotificationCenter) private readonly notificationCenter: NotificationCenter; - @inject(BoardsDataStore) private readonly boardDataStore: BoardsDataStore; @@ -129,6 +186,10 @@ export class InoLanguage extends SketchContribution { if (!port) { return; } + const portNumber = Number.parseInt(port, 10); // TODO: IDE2 APIs should provide a number and not string + if (Number.isNaN(portNumber)) { + return; + } const release = await this.languageServerStartMutex.acquire(); const toDisposeOnRelease = new DisposableCollection(); try { @@ -197,22 +258,22 @@ export class InoLanguage extends SketchContribution { ); toDisposeOnRelease.push(Disposable.create(() => clearTimeout(timer))); }), - this.commandService.executeCommand( - 'arduino.languageserver.start', - { - lsPath, - cliDaemonAddr: `localhost:${port}`, - clangdPath, - log: currentSketchPath ? currentSketchPath : log, - cliDaemonInstance: '1', - board: { - fqbn: fqbnWithConfig, - name: name ? `"${name}"` : undefined, - }, - realTimeDiagnostics, - silentOutput: true, - } - ), + this.start({ + lsPath, + daemonAddress: { + hostname: 'localhost', + port: portNumber, + instance: 1, // TODO: get it from the backend + }, + clangdPath, + log: currentSketchPath ? currentSketchPath : log, + board: { + fqbn: fqbnWithConfig, + name, + }, + realTimeDiagnostics, + silentOutput: true, + }), ]); } catch (e) { console.log(`Failed to start language server. Original FQBN: ${fqbn}`, e); @@ -222,4 +283,13 @@ export class InoLanguage extends SketchContribution { release(); } } + + private async start( + params: StartLanguageServerParams + ): Promise { + return this.commandService.executeCommand( + 'arduino.languageserver.start', + params + ); + } } diff --git a/arduino-ide-extension/src/browser/contributions/select-programmer.ts b/arduino-ide-extension/src/browser/contributions/select-programmer.ts new file mode 100644 index 000000000..4aac99467 --- /dev/null +++ b/arduino-ide-extension/src/browser/contributions/select-programmer.ts @@ -0,0 +1,87 @@ +import { nls } from '@theia/core/lib/common/nls'; +import { + QuickPickItem, + QuickPickService, +} from '@theia/core/lib/common/quick-pick-service'; +import { inject, injectable } from '@theia/core/shared/inversify'; +import { Programmer } from '../../common/protocol'; +import { BoardsDataStore } from '../boards/boards-data-store'; +import { BoardsServiceProvider } from '../boards/boards-service-provider'; +import { CommandRegistry, Contribution } from './contribution'; + +class ProgrammerQuickPickItem implements QuickPickItem { + constructor( + readonly programmer: Readonly, + readonly label = programmer.name, + readonly description = programmer.id + ) {} +} + +@injectable() +export class SelectProgrammer extends Contribution { + @inject(BoardsServiceProvider) + private readonly boardsServiceProvider: BoardsServiceProvider; + @inject(BoardsDataStore) + private readonly boardsDataStore: BoardsDataStore; + @inject(QuickPickService) + private readonly quickPickService: QuickPickService; + + override registerCommands(registry: CommandRegistry): void { + registry.registerCommand(SelectProgrammer.Commands.SELECT_PROGRAMMER, { + execute: () => + this.selectProgrammer( + this.boardsServiceProvider.boardsConfig.selectedBoard?.fqbn + ), + }); + } + + private async pickProgrammer( + fqbn: string | undefined + ): Promise { + const { programmers, selectedProgrammer } = + await this.boardsDataStore.getData(fqbn); + if (!programmers.length) { + return undefined; + } + const items = programmers.map((p) => new ProgrammerQuickPickItem(p)); + const activeItem = items.find( + (i) => i.programmer.id === selectedProgrammer?.id + ); + const selected = await this.quickPickService.show(items, { + activeItem, + placeholder: nls.localize( + 'arduino/quickSelectProgrammer', + 'Type the programmer. Press Enter to confirm or Escape to cancel.' + ), + matchOnDescription: true, + }); + return selected?.programmer; + } + + private async selectProgrammer( + fqbn: string | undefined + ): Promise { + if (!fqbn) { + return undefined; + } + const programmer = await this.pickProgrammer(fqbn); + if (programmer) { + const ok = await this.boardsDataStore.selectProgrammer({ + fqbn, + selectedProgrammer: programmer, + }); + if (ok) { + return programmer; + } + } + return undefined; + } +} + +export namespace SelectProgrammer { + export namespace Commands { + export const SELECT_PROGRAMMER = { + id: 'arduino-select-programmer', + }; + } +} diff --git a/arduino-ide-extension/src/browser/sketches-service-client-impl.ts b/arduino-ide-extension/src/browser/sketches-service-client-impl.ts index f0186454c..9b3cdac94 100644 --- a/arduino-ide-extension/src/browser/sketches-service-client-impl.ts +++ b/arduino-ide-extension/src/browser/sketches-service-client-impl.ts @@ -67,6 +67,7 @@ export class SketchesServiceClientImpl ); private _currentSketch: CurrentSketch | undefined; + private _currentIdeTempFolderUri: URI | undefined; private currentSketchLoaded = new Deferred(); onStart(): void { @@ -74,7 +75,10 @@ export class SketchesServiceClientImpl this.watchSketchbookDir(sketchDirUri); const refreshCurrentSketch = async () => { const currentSketch = await this.loadCurrentSketch(); - this.useCurrentSketch(currentSketch); + const ideTempFolderUri = await this.getIdeTempFolderUriForSketch( + currentSketch + ); + this.useCurrentSketch(currentSketch, ideTempFolderUri); }; this.toDispose.push( this.configService.onDidChangeSketchDirUri((sketchDirUri) => { @@ -141,7 +145,10 @@ export class SketchesServiceClientImpl } if (!Sketch.sameAs(this._currentSketch, reloadedSketch)) { - this.useCurrentSketch(reloadedSketch, true); + const ideTempFolderUri = await this.getIdeTempFolderUriForSketch( + reloadedSketch + ); + this.useCurrentSketch(reloadedSketch, ideTempFolderUri, true); } return; } @@ -179,11 +186,23 @@ export class SketchesServiceClientImpl ]); } + private async getIdeTempFolderUriForSketch( + sketch: CurrentSketch + ): Promise { + if (CurrentSketch.isValid(sketch)) { + const uri = await this.sketchesService.getIdeTempFolderUri(sketch); + return new URI(uri); + } + return undefined; + } + private useCurrentSketch( currentSketch: CurrentSketch, + ideTempFolderUri: URI | undefined, reassignPromise = false ) { this._currentSketch = currentSketch; + this._currentIdeTempFolderUri = ideTempFolderUri; if (reassignPromise) { this.currentSketchLoaded = new Deferred(); } @@ -273,6 +292,14 @@ export class SketchesServiceClientImpl return false; } + if ( + this._currentIdeTempFolderUri && + this._currentIdeTempFolderUri.resolve('launch.json').toString() === + toCheck.toString() + ) { + return false; + } + const isCloudSketch = toCheck .toString() .includes(`${REMOTE_SKETCHBOOK_FOLDER}/${ARDUINO_CLOUD_FOLDER}`); diff --git a/arduino-ide-extension/src/browser/theia/debug/debug-configuration-manager.ts b/arduino-ide-extension/src/browser/theia/debug/debug-configuration-manager.ts index f877e0e12..6e0210a41 100644 --- a/arduino-ide-extension/src/browser/theia/debug/debug-configuration-manager.ts +++ b/arduino-ide-extension/src/browser/theia/debug/debug-configuration-manager.ts @@ -1,44 +1,44 @@ -import debounce from 'p-debounce'; -import { inject, injectable } from '@theia/core/shared/inversify'; -import URI from '@theia/core/lib/common/uri'; -import { Event, Emitter } from '@theia/core/lib/common/event'; import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state'; -import { DebugConfiguration } from '@theia/debug/lib/common/debug-common'; -import { DebugConfigurationModel as TheiaDebugConfigurationModel } from '@theia/debug/lib/browser/debug-configuration-model'; +import { Disposable } from '@theia/core/lib/common/disposable'; +import { Emitter, Event } from '@theia/core/lib/common/event'; +import URI from '@theia/core/lib/common/uri'; +import { inject, injectable } from '@theia/core/shared/inversify'; import { DebugConfigurationManager as TheiaDebugConfigurationManager } from '@theia/debug/lib/browser/debug-configuration-manager'; +import { DebugConfigurationModel as TheiaDebugConfigurationModel } from '@theia/debug/lib/browser/debug-configuration-model'; +import { DebugConfiguration } from '@theia/debug/lib/common/debug-common'; +import { FileService } from '@theia/filesystem/lib/browser/file-service'; +import { + FileOperationError, + FileOperationResult, +} from '@theia/filesystem/lib/common/files'; +import debounce from 'p-debounce'; import { SketchesService } from '../../../common/protocol'; import { CurrentSketch, SketchesServiceClientImpl, } from '../../sketches-service-client-impl'; +import { maybeUpdateReadOnlyState } from '../monaco/monaco-editor-provider'; import { DebugConfigurationModel } from './debug-configuration-model'; -import { - FileOperationError, - FileOperationResult, -} from '@theia/filesystem/lib/common/files'; -import { FileService } from '@theia/filesystem/lib/browser/file-service'; @injectable() export class DebugConfigurationManager extends TheiaDebugConfigurationManager { @inject(SketchesService) - protected readonly sketchesService: SketchesService; - + private readonly sketchesService: SketchesService; @inject(SketchesServiceClientImpl) - protected readonly sketchesServiceClient: SketchesServiceClientImpl; - + private readonly sketchesServiceClient: SketchesServiceClientImpl; @inject(FrontendApplicationStateService) - protected readonly appStateService: FrontendApplicationStateService; - + private readonly appStateService: FrontendApplicationStateService; @inject(FileService) - protected readonly fileService: FileService; + private readonly fileService: FileService; - protected onTempContentDidChangeEmitter = + private onTempContentDidChangeEmitter = new Emitter(); get onTempContentDidChange(): Event { return this.onTempContentDidChangeEmitter.event; } protected override async doInit(): Promise { + this.watchLaunchConfigEditor(); this.appStateService.reachedState('ready').then(async () => { const tempContent = await this.getTempLaunchJsonContent(); if (!tempContent) { @@ -75,6 +75,19 @@ export class DebugConfigurationManager extends TheiaDebugConfigurationManager { return super.doInit(); } + /** + * Sets a listener on current sketch change, and maybe updates the readonly state of the editor showing the debug configuration. aka the `launch.json`. + */ + private watchLaunchConfigEditor(): Disposable { + return this.sketchesServiceClient.onCurrentSketchDidChange(() => { + for (const widget of this.editorManager.all) { + maybeUpdateReadOnlyState(widget, (uri) => + this.sketchesServiceClient.isReadOnly(uri) + ); + } + }); + } + protected override updateModels = debounce(async () => { await this.appStateService.reachedState('ready'); const roots = await this.workspaceService.roots; @@ -111,7 +124,7 @@ export class DebugConfigurationManager extends TheiaDebugConfigurationManager { this.updateCurrent(); }, 500); - protected async getTempLaunchJsonContent(): Promise< + private async getTempLaunchJsonContent(): Promise< (TheiaDebugConfigurationModel.JsonContent & { uri: URI }) | URI | undefined > { const sketch = await this.sketchesServiceClient.currentSketch(); diff --git a/arduino-ide-extension/src/browser/theia/monaco/monaco-editor-provider.ts b/arduino-ide-extension/src/browser/theia/monaco/monaco-editor-provider.ts index 524461b53..871cf8504 100644 --- a/arduino-ide-extension/src/browser/theia/monaco/monaco-editor-provider.ts +++ b/arduino-ide-extension/src/browser/theia/monaco/monaco-editor-provider.ts @@ -1,17 +1,20 @@ -import { inject, injectable } from '@theia/core/shared/inversify'; -import URI from '@theia/core/lib/common/uri'; +import { LOCKED_CLASS, lock } from '@theia/core/lib/browser/widgets/widget'; import { Disposable, DisposableCollection, } from '@theia/core/lib/common/disposable'; +import URI from '@theia/core/lib/common/uri'; +import { Title, Widget } from '@theia/core/shared/@phosphor/widgets'; +import { inject, injectable } from '@theia/core/shared/inversify'; +import { EditorWidget } from '@theia/editor/lib/browser/editor-widget'; +import * as monaco from '@theia/monaco-editor-core'; +import type { ReferencesModel } from '@theia/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel'; import { EditorServiceOverrides, MonacoEditor, } from '@theia/monaco/lib/browser/monaco-editor'; import { MonacoEditorProvider as TheiaMonacoEditorProvider } from '@theia/monaco/lib/browser/monaco-editor-provider'; import { SketchesServiceClientImpl } from '../../sketches-service-client-impl'; -import * as monaco from '@theia/monaco-editor-core'; -import type { ReferencesModel } from '@theia/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel'; type CancelablePromise = Promise & { cancel: () => void; @@ -101,3 +104,30 @@ export class MonacoEditorProvider extends TheiaMonacoEditorProvider { editor.updateOptions({ readOnly }); } } + +// Theia cannot dynamically set an editor to writable once it was readonly. +export function maybeUpdateReadOnlyState( + widget: EditorWidget, + isReadOnly: (uri: string | URI | monaco.Uri) => boolean +): void { + const editor = widget.editor; + if (!(editor instanceof MonacoEditor)) { + return; + } + const model = editor.document; + const oldReadOnly = model.readOnly; + const resource = model['resource']; + const newReadOnly = Boolean(resource.isReadonly) || isReadOnly(resource.uri); + if (oldReadOnly !== newReadOnly) { + editor.getControl().updateOptions({ readOnly: newReadOnly }); + if (newReadOnly) { + lock(widget.title); + } else { + unlock(widget.title); + } + } +} + +function unlock(title: Title): void { + title.className = title.className.replace(LOCKED_CLASS, '').trim(); +} diff --git a/arduino-ide-extension/src/browser/theia/monaco/monaco-text-model-service.ts b/arduino-ide-extension/src/browser/theia/monaco/monaco-text-model-service.ts index a7d530095..2943d4580 100644 --- a/arduino-ide-extension/src/browser/theia/monaco/monaco-text-model-service.ts +++ b/arduino-ide-extension/src/browser/theia/monaco/monaco-text-model-service.ts @@ -77,7 +77,7 @@ class MaybeReadonlyMonacoEditorModel extends SilentMonacoEditorModel { } this._dirty = dirty; if (dirty === false) { - (this as any).updateSavedVersionId(); + this['updateSavedVersionId'](); } this.onDirtyChangedEmitter.fire(undefined); } diff --git a/arduino-ide-extension/src/common/nls.ts b/arduino-ide-extension/src/common/nls.ts index 06c8baee7..459d40bf3 100644 --- a/arduino-ide-extension/src/common/nls.ts +++ b/arduino-ide-extension/src/common/nls.ts @@ -20,6 +20,10 @@ export const InstallManually = nls.localize( 'arduino/common/installManually', 'Install Manually' ); +export const SelectManually = nls.localize( + 'arduino/common/selectManually', + 'Select Manually' +); export const serialMonitorWidgetLabel = nls.localize( 'arduino/common/serialMonitor', diff --git a/arduino-ide-extension/src/common/protocol/boards-service.ts b/arduino-ide-extension/src/common/protocol/boards-service.ts index c485e6704..dc127db73 100644 --- a/arduino-ide-extension/src/common/protocol/boards-service.ts +++ b/arduino-ide-extension/src/common/protocol/boards-service.ts @@ -406,6 +406,7 @@ export interface Programmer { readonly name: string; readonly platform: string; readonly id: string; + readonly default?: boolean; } export namespace Programmer { export function equals( @@ -425,6 +426,20 @@ export namespace Programmer { ); } } +export function isProgrammer(arg: unknown): arg is Programmer { + return ( + typeof arg === 'object' && + arg !== null && + (arg).id !== undefined && + typeof (arg).id === 'string' && + (arg).name !== undefined && + typeof (arg).name === 'string' && + (arg).platform !== undefined && + typeof (arg).platform === 'string' && + ((arg).default === undefined || + typeof (arg).default === 'boolean') + ); +} export namespace Board { export function is(board: any): board is Board { diff --git a/arduino-ide-extension/src/common/protocol/sketches-service.ts b/arduino-ide-extension/src/common/protocol/sketches-service.ts index fd3d5c6a1..3901f1617 100644 --- a/arduino-ide-extension/src/common/protocol/sketches-service.ts +++ b/arduino-ide-extension/src/common/protocol/sketches-service.ts @@ -121,7 +121,7 @@ export interface SketchesService { * Hence, IDE2 has to provide multiple build paths on Windows. This hack will be obsolete when the CLI can provide error codes: * https://github.com/arduino/arduino-cli/issues/1762. */ - tempBuildPath(sketch: Sketch): Promise; + tempBuildPath(sketch: SketchRef): Promise; } export interface SketchRef { diff --git a/arduino-ide-extension/src/node/sketches-service-impl.ts b/arduino-ide-extension/src/node/sketches-service-impl.ts index 0fe8a2158..e14b123dd 100644 --- a/arduino-ide-extension/src/node/sketches-service-impl.ts +++ b/arduino-ide-extension/src/node/sketches-service-impl.ts @@ -555,12 +555,12 @@ export class SketchesServiceImpl return destinationUri; } - async getIdeTempFolderUri(sketch: Sketch): Promise { + async getIdeTempFolderUri(sketch: SketchRef): Promise { const genBuildPath = await this.getIdeTempFolderPath(sketch); return FileUri.create(genBuildPath).toString(); } - private async getIdeTempFolderPath(sketch: Sketch): Promise { + private async getIdeTempFolderPath(sketch: SketchRef): Promise { const sketchPath = FileUri.fsPath(sketch.uri); await fs.readdir(sketchPath); // Validates the sketch folder and rejects if not accessible. const suffix = crypto.createHash('md5').update(sketchPath).digest('hex'); diff --git a/arduino-ide-extension/src/node/theia/plugin-ext/plugin-reader.ts b/arduino-ide-extension/src/node/theia/plugin-ext/plugin-reader.ts index b9030b60b..9ad7625b3 100644 --- a/arduino-ide-extension/src/node/theia/plugin-ext/plugin-reader.ts +++ b/arduino-ide-extension/src/node/theia/plugin-ext/plugin-reader.ts @@ -12,25 +12,25 @@ export class HostedPluginReader extends TheiaHostedPluginReader { ): Promise { const scanner = this.scanner.getScanner(plugin); const contributions = await scanner.getContribution(plugin); - return this.filterContribution(plugin.name, contributions); + return this.mapContribution(plugin.name, contributions); } - private filterContribution( + private mapContribution( pluginName: string, contributions: PluginContribution | undefined ): PluginContribution | undefined { if (!contributions) { return contributions; } - const filter = pluginFilters.get(pluginName); - return filter ? filter(contributions) : contributions; + const mapper = pluginMappers.get(pluginName); + return mapper ? mapper(contributions) : contributions; } } -type PluginContributionFilter = ( +type PluginContributionMapper = ( contribution: PluginContribution ) => PluginContribution | undefined; -const cortexDebugFilter: PluginContributionFilter = ( +const cortexDebugMapper: PluginContributionMapper = ( contribution: PluginContribution ) => { if (contribution.viewsContainers) { @@ -81,9 +81,24 @@ const cortexDebugFilter: PluginContributionFilter = ( } } } + for (const _debugger of contribution.debuggers ?? []) { + if (_debugger.type === 'cortex-debug') { + for (const attributes of _debugger.configurationAttributes ?? []) { + if (attributes.properties) { + // Patch the cortex-debug debug config schema to allow the in-house `configId`. + attributes.properties['configId'] = { + type: 'string', + description: + 'Arduino debug configuration identifier consisting of the Fully Qualified Board Name (FQBN) and the programmer identifier (for example, `esptool`)', + }; + } + } + } + } + return contribution; }; -const pluginFilters = new Map([ - ['cortex-debug', cortexDebugFilter], +const pluginMappers = new Map([ + ['cortex-debug', cortexDebugMapper], ]); diff --git a/arduino-ide-extension/src/test/browser/auto-select-programmer.test.ts b/arduino-ide-extension/src/test/browser/auto-select-programmer.test.ts new file mode 100644 index 000000000..c94f54a09 --- /dev/null +++ b/arduino-ide-extension/src/test/browser/auto-select-programmer.test.ts @@ -0,0 +1,172 @@ +import { enableJSDOM } from '@theia/core/lib/browser/test/jsdom'; +const disableJSDOM = enableJSDOM(); + +import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider'; +FrontendApplicationConfigProvider.set({}); + +import { + Disposable, + DisposableCollection, +} from '@theia/core/lib/common/disposable'; +import { expect } from 'chai'; +import { BoardsDataStore } from '../../browser/boards/boards-data-store'; +import { ensureProgrammerIsSelected } from '../../browser/contributions/auto-select-programmer'; +import { Programmer } from '../../common/protocol'; + +disableJSDOM(); + +describe('auto-select-programmer', () => { + describe('ensureProgrammerIsSelected', () => { + let debugMessages: string[]; + const toDispose = new DisposableCollection(); + const fqbn = 'a:b:c'; + const programmer: Programmer = { + id: 'p1', + name: 'P1', + platform: 'a:b', + default: true, + }; + const anotherProgrammer: Programmer = { + id: 'p2', + name: 'P2', + platform: 'a:b', + }; + + before(() => { + const debug = console.debug; + console.debug = (message: string) => debugMessages.push(message); + toDispose.push(Disposable.create(() => (console.debug = debug))); + }); + + beforeEach(() => (debugMessages = [])); + + after(() => toDispose.dispose()); + + it('should not set when the fqbn is missing', async () => { + const ok = await ensureProgrammerIsSelected({ + fqbn: undefined, + getData: () => BoardsDataStore.Data.EMPTY, + loadBoardDetails: () => undefined, + selectProgrammer: () => false, + }); + expect(ok).to.be.false; + expect(debugMessages).to.be.empty; + }); + + it('should not set when no board details found (missing core)', async () => { + const ok = await ensureProgrammerIsSelected({ + fqbn, + getData: () => BoardsDataStore.Data.EMPTY, + loadBoardDetails: () => undefined, + selectProgrammer: () => false, + }); + expect(ok).to.be.false; + expect(debugMessages).to.be.deep.equal([ + 'Ensuring a programmer is selected for a:b:c...', + 'Skipping. No boards data is available for a:b:c.', + ]); + }); + + it('should be noop when the programmer is already selected', async () => { + const ok = await ensureProgrammerIsSelected({ + fqbn, + getData: () => ({ + configOptions: [], + programmers: [programmer], + selectedProgrammer: programmer, + }), + loadBoardDetails: () => undefined, + selectProgrammer: () => false, + }); + expect(ok).to.be.true; + expect(debugMessages).to.be.deep.equal([ + 'Ensuring a programmer is selected for a:b:c...', + "A programmer is already selected for a:b:c: 'p1'.", + ]); + }); + + it('should automatically select the default one if not selected', async () => { + const selectedProgrammers: Record = {}; + const ok = await ensureProgrammerIsSelected({ + fqbn, + getData: () => ({ + configOptions: [], + programmers: [anotherProgrammer, programmer], + selectedProgrammer: undefined, + }), + loadBoardDetails: () => undefined, + selectProgrammer: (arg) => { + selectedProgrammers[arg.fqbn] = arg.selectedProgrammer; + return true; + }, + }); + expect(ok).to.be.true; + expect(debugMessages).to.be.deep.equal([ + 'Ensuring a programmer is selected for a:b:c...', + "Selected 'p1' programmer for a:b:c.", + ]); + expect(selectedProgrammers).to.be.deep.equal({ + [fqbn]: programmer, + }); + }); + + it('should not select the programmer when loading the board details fails', async () => { + const ok = await ensureProgrammerIsSelected({ + fqbn, + getData: () => ({ + configOptions: [], + programmers: [], + selectedProgrammer: undefined, + }), + loadBoardDetails: () => undefined, + selectProgrammer: () => false, + }); + expect(ok).to.be.false; + expect(debugMessages).to.be.deep.equal([ + 'Ensuring a programmer is selected for a:b:c...', + 'Skipping. No boards data is available for a:b:c.', + ]); + }); + + it('should select the programmer after reloading the data', async () => { + const selectedProgrammers: Record = {}; + const ok = await ensureProgrammerIsSelected({ + fqbn, + getData: () => ({ + configOptions: [ + { + label: 'config', + option: 'opt1', + values: [{ label: 'Opt1', selected: true, value: 'Value' }], + }, + ], + programmers: [], + selectedProgrammer: undefined, + }), + loadBoardDetails: () => ({ + fqbn, + requiredTools: [], + configOptions: [], + programmers: [programmer, anotherProgrammer], + debuggingSupported: false, + VID: 'VID', + PID: 'PID', + buildProperties: [], + }), + selectProgrammer: (arg) => { + selectedProgrammers[arg.fqbn] = arg.selectedProgrammer; + return true; + }, + }); + expect(ok).to.be.true; + expect(debugMessages).to.be.deep.equal([ + 'Ensuring a programmer is selected for a:b:c...', + 'Reloading board details for a:b:c...', + "Selected 'p1' programmer for a:b:c.", + ]); + expect(selectedProgrammers).to.be.deep.equal({ + [fqbn]: programmer, + }); + }); + }); +}); diff --git a/electron-app/package.json b/electron-app/package.json index 3254dd07e..bc8ef0545 100644 --- a/electron-app/package.json +++ b/electron-app/package.json @@ -196,7 +196,7 @@ "theiaPlugins": { "vscode-builtin-cpp": "https://open-vsx.org/api/vscode/cpp/1.52.1/file/vscode.cpp-1.52.1.vsix", "vscode-arduino-api": "https://github.com/dankeboy36/vscode-arduino-api/releases/download/0.1.2/vscode-arduino-api-0.1.2.vsix", - "vscode-arduino-tools": "https://downloads.arduino.cc/vscode-arduino-tools/vscode-arduino-tools-0.0.2-beta.8.vsix", + "vscode-arduino-tools": "https://github.com/arduino/vscode-arduino-tools/raw/cli-0.35.0-rc.1/build-artifacts/vscode-arduino-tools-0.1.0-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://downloads.arduino.cc/marus25.cortex-debug/marus25.cortex-debug-1.5.1.vsix", diff --git a/i18n/en.json b/i18n/en.json index 91b37f6a1..255705879 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -146,6 +146,7 @@ "processing": "Processing", "recommended": "Recommended", "retired": "Retired", + "selectManually": "Select Manually", "selectedOn": "on {0}", "serialMonitor": "Serial Monitor", "type": "Type", @@ -209,8 +210,10 @@ "debug": { "debugWithMessage": "Debug - {0}", "debuggingNotSupported": "Debugging is not supported by '{0}'", + "getDebugInfo": "Getting debug info...", "noPlatformInstalledFor": "Platform is not installed for '{0}'", "optimizeForDebugging": "Optimize for Debugging", + "programmerNotSelected": "The debugger requires a programmer. Do you want to select a programmer? You can select it manually from the Tools > Programmer menu.", "sketchIsNotCompiled": "Sketch '{0}' must be verified before starting a debug session. Please verify the sketch and start debugging again. Do you want to verify the sketch now?" }, "developer": { @@ -413,6 +416,7 @@ "deprecationMessage": "Deprecated. Use 'window.zoomLevel' instead." } }, + "quickSelectProgrammer": "Type the programmer. Press Enter to confirm or Escape to cancel.", "renameCloudSketch": { "renameSketchTitle": "New name of the Cloud Sketch" }, From 0e3b6323fe276c8795dfad19e8eddcef2d8959f6 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Thu, 9 Nov 2023 16:15:49 +0100 Subject: [PATCH 2/6] feat: show in tooltip if core is from sketchbook Closes #2270 Signed-off-by: Akos Kitta --- .../boards/boards-config-component.tsx | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/arduino-ide-extension/src/browser/boards/boards-config-component.tsx b/arduino-ide-extension/src/browser/boards/boards-config-component.tsx index acf2c7d4e..f14b8f390 100644 --- a/arduino-ide-extension/src/browser/boards/boards-config-component.tsx +++ b/arduino-ide-extension/src/browser/boards/boards-config-component.tsx @@ -48,16 +48,17 @@ namespace BoardsConfigComponent { } } -export abstract class Item extends React.Component<{ +class Item extends React.Component<{ item: T; label: string; selected: boolean; onClick: (item: T) => void; missing?: boolean; details?: string; + title?: string | ((item: T) => string); }> { override render(): React.ReactNode { - const { selected, label, missing, details } = this.props; + const { selected, label, missing, details, item } = this.props; const classNames = ['item']; if (selected) { classNames.push('selected'); @@ -65,11 +66,15 @@ export abstract class Item extends React.Component<{ if (missing === true) { classNames.push('missing'); } + let title = this.props.title ?? `${label}${!details ? '' : details}`; + if (typeof title === 'function') { + title = title(item); + } return (
{label}
{!details ? '' :
{details}
} @@ -234,9 +239,20 @@ export class BoardsConfigComponent extends React.Component< distinctBoards.set(key, board); } } + const title = (board: Board.Detailed): string => { + const { details, manuallyInstalled } = board; + let label = board.name; + if (details) { + label += details; + } + if (manuallyInstalled) { + label += nls.localize('arduino/board/inSketchbook', ' (in Sketchbook)'); + } + return label; + }; const boardsList = Array.from(distinctBoards.values()).map((board) => ( - + key={toKey(board)} item={board} label={board.name} @@ -244,6 +260,7 @@ export class BoardsConfigComponent extends React.Component< selected={board.selected} onClick={this.selectBoard} missing={board.missing} + title={title} /> )); From 346c8aab2b721677f8d671544b6d11e1d4a1d752 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Tue, 24 Oct 2023 16:21:59 +0200 Subject: [PATCH 3/6] feat: handle `v` prefix in CLI GH release name Ref: arduino/arduino-cli#2374 Signed-off-by: Akos Kitta --- arduino-ide-extension/scripts/generate-protocol.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arduino-ide-extension/scripts/generate-protocol.js b/arduino-ide-extension/scripts/generate-protocol.js index 5b5301575..ec15850b3 100644 --- a/arduino-ide-extension/scripts/generate-protocol.js +++ b/arduino-ide-extension/scripts/generate-protocol.js @@ -6,6 +6,7 @@ const { mkdirSync, promises: fs } = require('node:fs'); const { exec } = require('./utils'); const glob = require('glob'); + const { SemVer, gte, valid: validSemVer } = require('semver'); const protoc = path.dirname(require('protoc/protoc')); const repository = await fs.mkdtemp(path.join(os.tmpdir(), 'arduino-cli-')); @@ -94,13 +95,12 @@ } */ const versionObject = JSON.parse(versionJson); - const version = versionObject.VersionString; - if ( - version && - !version.startsWith('nightly-') && - version !== '0.0.0-git' && - version !== 'git-snapshot' - ) { + let version = versionObject.VersionString; + if (validSemVer(version)) { + // https://github.com/arduino/arduino-cli/pull/2374 + if (gte(new SemVer(version, { loose: true }), new SemVer('0.35.0-rc.1'))) { + version = `v${version}`; + } console.log(`>>> Checking out tagged version: '${version}'...`); exec('git', ['-C', repository, 'fetch', '--all', '--tags'], { logStdout: true, From 128dcf33d77f90653e63facf0ed068758880ed1a Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Tue, 24 Oct 2023 16:48:55 +0200 Subject: [PATCH 4/6] chore(cli): update CLI to `0.35.0-rc.2` - Adjust board discovery to new gRPC API. From now on, it's a client read stream, not a duplex. - Allow `.cxx` and `.cc` file extensions. (Closes #2265) Signed-off-by: Akos Kitta --- arduino-ide-extension/package.json | 2 +- .../src/common/protocol/sketches-service.ts | 2 +- .../src/node/board-discovery.ts | 42 +- .../cc/arduino/cli/commands/v1/board_pb.d.ts | 3 - .../cc/arduino/cli/commands/v1/board_pb.js | 32 +- .../cli/commands/v1/commands_grpc_pb.d.ts | 47 +- .../cli/commands/v1/commands_grpc_pb.js | 70 +- .../arduino/cli/commands/v1/commands_pb.d.ts | 1 + .../cc/arduino/cli/commands/v1/commands_pb.js | 2 + .../cc/arduino/cli/commands/v1/core_pb.d.ts | 9 + .../cc/arduino/cli/commands/v1/core_pb.js | 96 +- .../arduino/cli/commands/v1/debug_grpc_pb.js | 1 + .../cli/{debug => commands}/v1/debug_pb.d.ts | 109 +- .../cc/arduino/cli/commands/v1/debug_pb.js | 1725 +++++++++++++++++ .../arduino/cli/debug/v1/debug_grpc_pb.d.ts | 59 - .../cc/arduino/cli/debug/v1/debug_grpc_pb.js | 95 - .../cc/arduino/cli/debug/v1/debug_pb.js | 1233 ------------ .../cli/monitor/v1/monitor_grpc_pb.d.ts | 42 - .../arduino/cli/monitor/v1/monitor_grpc_pb.js | 65 - .../cc/arduino/cli/monitor/v1/monitor_pb.d.ts | 131 -- .../cc/arduino/cli/monitor/v1/monitor_pb.js | 819 -------- 21 files changed, 2037 insertions(+), 2548 deletions(-) create mode 100644 arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_grpc_pb.js rename arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/{debug => commands}/v1/debug_pb.d.ts (51%) create mode 100644 arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.js delete mode 100644 arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.d.ts delete mode 100644 arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.js delete mode 100644 arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.js delete mode 100644 arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_grpc_pb.d.ts delete mode 100644 arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_grpc_pb.js delete mode 100644 arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_pb.d.ts delete mode 100644 arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_pb.js diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json index 866844ab8..a8715a45d 100644 --- a/arduino-ide-extension/package.json +++ b/arduino-ide-extension/package.json @@ -169,7 +169,7 @@ ], "arduino": { "arduino-cli": { - "version": "0.34.0" + "version": "0.35.0-rc.2" }, "arduino-fwuploader": { "version": "2.4.1" diff --git a/arduino-ide-extension/src/common/protocol/sketches-service.ts b/arduino-ide-extension/src/common/protocol/sketches-service.ts index 3901f1617..3c98252c1 100644 --- a/arduino-ide-extension/src/common/protocol/sketches-service.ts +++ b/arduino-ide-extension/src/common/protocol/sketches-service.ts @@ -308,7 +308,7 @@ export namespace Sketch { export namespace Extensions { export const DEFAULT = '.ino'; export const MAIN = [DEFAULT, '.pde']; - export const SOURCE = ['.c', '.cpp', '.S']; + export const SOURCE = ['.c', '.cpp', '.S', '.cxx', '.cc']; export const CODE_FILES = [ ...MAIN, ...SOURCE, diff --git a/arduino-ide-extension/src/node/board-discovery.ts b/arduino-ide-extension/src/node/board-discovery.ts index 5d6c137de..628ed97ec 100644 --- a/arduino-ide-extension/src/node/board-discovery.ts +++ b/arduino-ide-extension/src/node/board-discovery.ts @@ -1,4 +1,4 @@ -import type { ClientDuplexStream } from '@grpc/grpc-js'; +import type { ClientReadableStream } from '@grpc/grpc-js'; import { Disposable, DisposableCollection, @@ -30,9 +30,9 @@ import type { Port as RpcPort } from './cli-protocol/cc/arduino/cli/commands/v1/ import { CoreClientAware } from './core-client-provider'; import { ServiceError } from './service-error'; -type Duplex = ClientDuplexStream; +type Stream = ClientReadableStream; interface StreamWrapper extends Disposable { - readonly stream: Duplex; + readonly stream: Stream; readonly uuid: string; // For logging only } @@ -121,34 +121,15 @@ export class BoardDiscovery return Disposable.create(() => clearTimeout(timer)); } - private async requestStartWatch( - req: BoardListWatchRequest, - duplex: Duplex - ): Promise { - return new Promise((resolve, reject) => { - if ( - !duplex.write(req, (err: Error | undefined) => { - if (err) { - reject(err); - return; - } - }) - ) { - duplex.once('drain', resolve); - } else { - process.nextTick(resolve); - } - }); - } - private async createWrapper( - client: ArduinoCoreServiceClient + client: ArduinoCoreServiceClient, + req: BoardListWatchRequest ): Promise { if (this.wrapper) { throw new Error(`Duplex was already set.`); } const stream = client - .boardListWatch() + .boardListWatch(req) .on('end', () => { this.logger.info('received end'); this.onStreamDidEndEmitter.fire(); @@ -202,14 +183,11 @@ export class BoardDiscovery this.watching = new Deferred(); this.logger.info('start new deferred'); const { client, instance } = await this.coreClient; - const wrapper = await this.createWrapper(client); - wrapper.stream.on('data', (resp) => this.onBoardListWatchResponse(resp)); - this.logger.info('start request start watch'); - await this.requestStartWatch( - new BoardListWatchRequest().setInstance(instance), - wrapper.stream + const wrapper = await this.createWrapper( + client, + new BoardListWatchRequest().setInstance(instance) ); - this.logger.info('start requested start watch'); + wrapper.stream.on('data', (resp) => this.onBoardListWatchResponse(resp)); this.watching.resolve(); this.logger.info('start resolved watching'); } diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.d.ts index fbf5b47b7..cf1864b9d 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.d.ts @@ -488,8 +488,6 @@ export class BoardListWatchRequest extends jspb.Message { clearInstance(): void; getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined; setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): BoardListWatchRequest; - getInterrupt(): boolean; - setInterrupt(value: boolean): BoardListWatchRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): BoardListWatchRequest.AsObject; @@ -504,7 +502,6 @@ export class BoardListWatchRequest extends jspb.Message { export namespace BoardListWatchRequest { export type AsObject = { instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, - interrupt: boolean, } } diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.js index da5148eac..76a3fb175 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/board_pb.js @@ -4181,8 +4181,7 @@ proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.prototype.toObject = func */ proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.toObject = function(includeInstance, msg) { var f, obj = { - instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), - interrupt: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f) }; if (includeInstance) { @@ -4224,10 +4223,6 @@ proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.deserializeBinaryFromRead reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Instance.deserializeBinaryFromReader); msg.setInstance(value); break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setInterrupt(value); - break; default: reader.skipField(); break; @@ -4265,13 +4260,6 @@ proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.serializeBinaryToWriter = cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter ); } - f = message.getInterrupt(); - if (f) { - writer.writeBool( - 2, - f - ); - } }; @@ -4312,24 +4300,6 @@ proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.prototype.hasInstance = f }; -/** - * optional bool interrupt = 2; - * @return {boolean} - */ -proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.prototype.getInterrupt = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.cc.arduino.cli.commands.v1.BoardListWatchRequest} returns this - */ -proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.prototype.setInterrupt = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); -}; - - diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts index c5159b1cb..0349bbbb4 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.d.ts @@ -11,6 +11,7 @@ import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino import * as cc_arduino_cli_commands_v1_board_pb from "../../../../../cc/arduino/cli/commands/v1/board_pb"; import * as cc_arduino_cli_commands_v1_compile_pb from "../../../../../cc/arduino/cli/commands/v1/compile_pb"; import * as cc_arduino_cli_commands_v1_core_pb from "../../../../../cc/arduino/cli/commands/v1/core_pb"; +import * as cc_arduino_cli_commands_v1_debug_pb from "../../../../../cc/arduino/cli/commands/v1/debug_pb"; import * as cc_arduino_cli_commands_v1_monitor_pb from "../../../../../cc/arduino/cli/commands/v1/monitor_pb"; import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino/cli/commands/v1/upload_pb"; import * as cc_arduino_cli_commands_v1_lib_pb from "../../../../../cc/arduino/cli/commands/v1/lib_pb"; @@ -55,6 +56,8 @@ interface IArduinoCoreServiceService extends grpc.ServiceDefinition { @@ -185,7 +188,7 @@ interface IArduinoCoreServiceService_IBoardSearch extends grpc.MethodDefinition< } interface IArduinoCoreServiceService_IBoardListWatch extends grpc.MethodDefinition { path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/BoardListWatch"; - requestStream: true; + requestStream: false; responseStream: true; requestSerialize: grpc.serialize; requestDeserialize: grpc.deserialize; @@ -408,6 +411,24 @@ interface IArduinoCoreServiceService_IEnumerateMonitorPortSettings extends grpc. responseSerialize: grpc.serialize; responseDeserialize: grpc.deserialize; } +interface IArduinoCoreServiceService_IDebug extends grpc.MethodDefinition { + path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/Debug"; + requestStream: true; + responseStream: true; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IArduinoCoreServiceService_IGetDebugConfig extends grpc.MethodDefinition { + path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/GetDebugConfig"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} export const ArduinoCoreServiceService: IArduinoCoreServiceService; @@ -426,7 +447,7 @@ export interface IArduinoCoreServiceServer extends grpc.UntypedServiceImplementa boardList: grpc.handleUnaryCall; boardListAll: grpc.handleUnaryCall; boardSearch: grpc.handleUnaryCall; - boardListWatch: grpc.handleBidiStreamingCall; + boardListWatch: grpc.handleServerStreamingCall; compile: grpc.handleServerStreamingCall; platformInstall: grpc.handleServerStreamingCall; platformDownload: grpc.handleServerStreamingCall; @@ -451,6 +472,8 @@ export interface IArduinoCoreServiceServer extends grpc.UntypedServiceImplementa libraryList: grpc.handleUnaryCall; monitor: grpc.handleBidiStreamingCall; enumerateMonitorPortSettings: grpc.handleUnaryCall; + debug: grpc.handleBidiStreamingCall; + getDebugConfig: grpc.handleUnaryCall; } export interface IArduinoCoreServiceClient { @@ -493,9 +516,8 @@ export interface IArduinoCoreServiceClient { boardSearch(request: cc_arduino_cli_commands_v1_board_pb.BoardSearchRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardSearchResponse) => void): grpc.ClientUnaryCall; boardSearch(request: cc_arduino_cli_commands_v1_board_pb.BoardSearchRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardSearchResponse) => void): grpc.ClientUnaryCall; boardSearch(request: cc_arduino_cli_commands_v1_board_pb.BoardSearchRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardSearchResponse) => void): grpc.ClientUnaryCall; - boardListWatch(): grpc.ClientDuplexStream; - boardListWatch(options: Partial): grpc.ClientDuplexStream; - boardListWatch(metadata: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; + boardListWatch(request: cc_arduino_cli_commands_v1_board_pb.BoardListWatchRequest, options?: Partial): grpc.ClientReadableStream; + boardListWatch(request: cc_arduino_cli_commands_v1_board_pb.BoardListWatchRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; compile(request: cc_arduino_cli_commands_v1_compile_pb.CompileRequest, options?: Partial): grpc.ClientReadableStream; compile(request: cc_arduino_cli_commands_v1_compile_pb.CompileRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; platformInstall(request: cc_arduino_cli_commands_v1_core_pb.PlatformInstallRequest, options?: Partial): grpc.ClientReadableStream; @@ -553,6 +575,12 @@ export interface IArduinoCoreServiceClient { enumerateMonitorPortSettings(request: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsResponse) => void): grpc.ClientUnaryCall; enumerateMonitorPortSettings(request: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsResponse) => void): grpc.ClientUnaryCall; enumerateMonitorPortSettings(request: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsResponse) => void): grpc.ClientUnaryCall; + debug(): grpc.ClientDuplexStream; + debug(options: Partial): grpc.ClientDuplexStream; + debug(metadata: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; + getDebugConfig(request: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; + getDebugConfig(request: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; + getDebugConfig(request: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; } export class ArduinoCoreServiceClient extends grpc.Client implements IArduinoCoreServiceClient { @@ -596,8 +624,8 @@ export class ArduinoCoreServiceClient extends grpc.Client implements IArduinoCor public boardSearch(request: cc_arduino_cli_commands_v1_board_pb.BoardSearchRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardSearchResponse) => void): grpc.ClientUnaryCall; public boardSearch(request: cc_arduino_cli_commands_v1_board_pb.BoardSearchRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardSearchResponse) => void): grpc.ClientUnaryCall; public boardSearch(request: cc_arduino_cli_commands_v1_board_pb.BoardSearchRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_board_pb.BoardSearchResponse) => void): grpc.ClientUnaryCall; - public boardListWatch(options?: Partial): grpc.ClientDuplexStream; - public boardListWatch(metadata?: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; + public boardListWatch(request: cc_arduino_cli_commands_v1_board_pb.BoardListWatchRequest, options?: Partial): grpc.ClientReadableStream; + public boardListWatch(request: cc_arduino_cli_commands_v1_board_pb.BoardListWatchRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; public compile(request: cc_arduino_cli_commands_v1_compile_pb.CompileRequest, options?: Partial): grpc.ClientReadableStream; public compile(request: cc_arduino_cli_commands_v1_compile_pb.CompileRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; public platformInstall(request: cc_arduino_cli_commands_v1_core_pb.PlatformInstallRequest, options?: Partial): grpc.ClientReadableStream; @@ -654,4 +682,9 @@ export class ArduinoCoreServiceClient extends grpc.Client implements IArduinoCor public enumerateMonitorPortSettings(request: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsResponse) => void): grpc.ClientUnaryCall; public enumerateMonitorPortSettings(request: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsResponse) => void): grpc.ClientUnaryCall; public enumerateMonitorPortSettings(request: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsResponse) => void): grpc.ClientUnaryCall; + public debug(options?: Partial): grpc.ClientDuplexStream; + public debug(metadata?: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; + public getDebugConfig(request: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; + public getDebugConfig(request: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; + public getDebugConfig(request: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; } diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js index 8947c7570..690655b7a 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb.js @@ -23,6 +23,7 @@ var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cl var cc_arduino_cli_commands_v1_board_pb = require('../../../../../cc/arduino/cli/commands/v1/board_pb.js'); var cc_arduino_cli_commands_v1_compile_pb = require('../../../../../cc/arduino/cli/commands/v1/compile_pb.js'); var cc_arduino_cli_commands_v1_core_pb = require('../../../../../cc/arduino/cli/commands/v1/core_pb.js'); +var cc_arduino_cli_commands_v1_debug_pb = require('../../../../../cc/arduino/cli/commands/v1/debug_pb.js'); var cc_arduino_cli_commands_v1_monitor_pb = require('../../../../../cc/arduino/cli/commands/v1/monitor_pb.js'); var cc_arduino_cli_commands_v1_upload_pb = require('../../../../../cc/arduino/cli/commands/v1/upload_pb.js'); var cc_arduino_cli_commands_v1_lib_pb = require('../../../../../cc/arduino/cli/commands/v1/lib_pb.js'); @@ -225,6 +226,28 @@ function deserialize_cc_arduino_cli_commands_v1_CreateResponse(buffer_arg) { return cc_arduino_cli_commands_v1_commands_pb.CreateResponse.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_cc_arduino_cli_commands_v1_DebugRequest(arg) { + if (!(arg instanceof cc_arduino_cli_commands_v1_debug_pb.DebugRequest)) { + throw new Error('Expected argument of type cc.arduino.cli.commands.v1.DebugRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_cc_arduino_cli_commands_v1_DebugRequest(buffer_arg) { + return cc_arduino_cli_commands_v1_debug_pb.DebugRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_cc_arduino_cli_commands_v1_DebugResponse(arg) { + if (!(arg instanceof cc_arduino_cli_commands_v1_debug_pb.DebugResponse)) { + throw new Error('Expected argument of type cc.arduino.cli.commands.v1.DebugResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_cc_arduino_cli_commands_v1_DebugResponse(buffer_arg) { + return cc_arduino_cli_commands_v1_debug_pb.DebugResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_cc_arduino_cli_commands_v1_DestroyRequest(arg) { if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.DestroyRequest)) { throw new Error('Expected argument of type cc.arduino.cli.commands.v1.DestroyRequest'); @@ -269,6 +292,28 @@ function deserialize_cc_arduino_cli_commands_v1_EnumerateMonitorPortSettingsResp return cc_arduino_cli_commands_v1_monitor_pb.EnumerateMonitorPortSettingsResponse.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_cc_arduino_cli_commands_v1_GetDebugConfigRequest(arg) { + if (!(arg instanceof cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigRequest)) { + throw new Error('Expected argument of type cc.arduino.cli.commands.v1.GetDebugConfigRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_cc_arduino_cli_commands_v1_GetDebugConfigRequest(buffer_arg) { + return cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_cc_arduino_cli_commands_v1_GetDebugConfigResponse(arg) { + if (!(arg instanceof cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse)) { + throw new Error('Expected argument of type cc.arduino.cli.commands.v1.GetDebugConfigResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_cc_arduino_cli_commands_v1_GetDebugConfigResponse(buffer_arg) { + return cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_cc_arduino_cli_commands_v1_GitLibraryInstallRequest(arg) { if (!(arg instanceof cc_arduino_cli_commands_v1_lib_pb.GitLibraryInstallRequest)) { throw new Error('Expected argument of type cc.arduino.cli.commands.v1.GitLibraryInstallRequest'); @@ -1065,7 +1110,7 @@ boardSearch: { // List boards connection and disconnected events. boardListWatch: { path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/BoardListWatch', - requestStream: true, + requestStream: false, responseStream: true, requestType: cc_arduino_cli_commands_v1_board_pb.BoardListWatchRequest, responseType: cc_arduino_cli_commands_v1_board_pb.BoardListWatchResponse, @@ -1367,5 +1412,28 @@ enumerateMonitorPortSettings: { responseSerialize: serialize_cc_arduino_cli_commands_v1_EnumerateMonitorPortSettingsResponse, responseDeserialize: deserialize_cc_arduino_cli_commands_v1_EnumerateMonitorPortSettingsResponse, }, + // Start a debug session and communicate with the debugger tool. +debug: { + path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Debug', + requestStream: true, + responseStream: true, + requestType: cc_arduino_cli_commands_v1_debug_pb.DebugRequest, + responseType: cc_arduino_cli_commands_v1_debug_pb.DebugResponse, + requestSerialize: serialize_cc_arduino_cli_commands_v1_DebugRequest, + requestDeserialize: deserialize_cc_arduino_cli_commands_v1_DebugRequest, + responseSerialize: serialize_cc_arduino_cli_commands_v1_DebugResponse, + responseDeserialize: deserialize_cc_arduino_cli_commands_v1_DebugResponse, + }, + getDebugConfig: { + path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/GetDebugConfig', + requestStream: false, + responseStream: false, + requestType: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigRequest, + responseType: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse, + requestSerialize: serialize_cc_arduino_cli_commands_v1_GetDebugConfigRequest, + requestDeserialize: deserialize_cc_arduino_cli_commands_v1_GetDebugConfigRequest, + responseSerialize: serialize_cc_arduino_cli_commands_v1_GetDebugConfigResponse, + responseDeserialize: deserialize_cc_arduino_cli_commands_v1_GetDebugConfigResponse, + }, }; diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts index 6957c8971..981a4c793 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.d.ts @@ -10,6 +10,7 @@ import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino import * as cc_arduino_cli_commands_v1_board_pb from "../../../../../cc/arduino/cli/commands/v1/board_pb"; import * as cc_arduino_cli_commands_v1_compile_pb from "../../../../../cc/arduino/cli/commands/v1/compile_pb"; import * as cc_arduino_cli_commands_v1_core_pb from "../../../../../cc/arduino/cli/commands/v1/core_pb"; +import * as cc_arduino_cli_commands_v1_debug_pb from "../../../../../cc/arduino/cli/commands/v1/debug_pb"; import * as cc_arduino_cli_commands_v1_monitor_pb from "../../../../../cc/arduino/cli/commands/v1/monitor_pb"; import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino/cli/commands/v1/upload_pb"; import * as cc_arduino_cli_commands_v1_lib_pb from "../../../../../cc/arduino/cli/commands/v1/lib_pb"; diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js index 5ce1aa6bc..7c8f9d694 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/commands_pb.js @@ -31,6 +31,8 @@ var cc_arduino_cli_commands_v1_compile_pb = require('../../../../../cc/arduino/c goog.object.extend(proto, cc_arduino_cli_commands_v1_compile_pb); var cc_arduino_cli_commands_v1_core_pb = require('../../../../../cc/arduino/cli/commands/v1/core_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_core_pb); +var cc_arduino_cli_commands_v1_debug_pb = require('../../../../../cc/arduino/cli/commands/v1/debug_pb.js'); +goog.object.extend(proto, cc_arduino_cli_commands_v1_debug_pb); var cc_arduino_cli_commands_v1_monitor_pb = require('../../../../../cc/arduino/cli/commands/v1/monitor_pb.js'); goog.object.extend(proto, cc_arduino_cli_commands_v1_monitor_pb); var cc_arduino_cli_commands_v1_upload_pb = require('../../../../../cc/arduino/cli/commands/v1/upload_pb.js'); diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.d.ts index 3034f8446..99b25cb15 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.d.ts @@ -23,6 +23,8 @@ export class PlatformInstallRequest extends jspb.Message { setSkipPostInstall(value: boolean): PlatformInstallRequest; getNoOverwrite(): boolean; setNoOverwrite(value: boolean): PlatformInstallRequest; + getSkipPreUninstall(): boolean; + setSkipPreUninstall(value: boolean): PlatformInstallRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): PlatformInstallRequest.AsObject; @@ -42,6 +44,7 @@ export namespace PlatformInstallRequest { version: string, skipPostInstall: boolean, noOverwrite: boolean, + skipPreUninstall: boolean, } } @@ -156,6 +159,8 @@ export class PlatformUninstallRequest extends jspb.Message { setPlatformPackage(value: string): PlatformUninstallRequest; getArchitecture(): string; setArchitecture(value: string): PlatformUninstallRequest; + getSkipPreUninstall(): boolean; + setSkipPreUninstall(value: boolean): PlatformUninstallRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): PlatformUninstallRequest.AsObject; @@ -172,6 +177,7 @@ export namespace PlatformUninstallRequest { instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, platformPackage: string, architecture: string, + skipPreUninstall: boolean, } } @@ -227,6 +233,8 @@ export class PlatformUpgradeRequest extends jspb.Message { setArchitecture(value: string): PlatformUpgradeRequest; getSkipPostInstall(): boolean; setSkipPostInstall(value: boolean): PlatformUpgradeRequest; + getSkipPreUninstall(): boolean; + setSkipPreUninstall(value: boolean): PlatformUpgradeRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): PlatformUpgradeRequest.AsObject; @@ -244,6 +252,7 @@ export namespace PlatformUpgradeRequest { platformPackage: string, architecture: string, skipPostInstall: boolean, + skipPreUninstall: boolean, } } diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.js index 837c234fe..9e49ed462 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.js @@ -368,7 +368,8 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.toObject = function(incl architecture: jspb.Message.getFieldWithDefault(msg, 3, ""), version: jspb.Message.getFieldWithDefault(msg, 4, ""), skipPostInstall: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), - noOverwrite: jspb.Message.getBooleanFieldWithDefault(msg, 6, false) + noOverwrite: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), + skipPreUninstall: jspb.Message.getBooleanFieldWithDefault(msg, 7, false) }; if (includeInstance) { @@ -430,6 +431,10 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.deserializeBinaryFromRea var value = /** @type {boolean} */ (reader.readBool()); msg.setNoOverwrite(value); break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSkipPreUninstall(value); + break; default: reader.skipField(); break; @@ -502,6 +507,13 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.serializeBinaryToWriter f ); } + f = message.getSkipPreUninstall(); + if (f) { + writer.writeBool( + 7, + f + ); + } }; @@ -632,6 +644,24 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.prototype.setNoOverwrite }; +/** + * optional bool skip_pre_uninstall = 7; + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.prototype.getSkipPreUninstall = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.cc.arduino.cli.commands.v1.PlatformInstallRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.prototype.setSkipPreUninstall = function(value) { + return jspb.Message.setProto3BooleanField(this, 7, value); +}; + + @@ -1361,7 +1391,8 @@ proto.cc.arduino.cli.commands.v1.PlatformUninstallRequest.toObject = function(in var f, obj = { instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), platformPackage: jspb.Message.getFieldWithDefault(msg, 2, ""), - architecture: jspb.Message.getFieldWithDefault(msg, 3, "") + architecture: jspb.Message.getFieldWithDefault(msg, 3, ""), + skipPreUninstall: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) }; if (includeInstance) { @@ -1411,6 +1442,10 @@ proto.cc.arduino.cli.commands.v1.PlatformUninstallRequest.deserializeBinaryFromR var value = /** @type {string} */ (reader.readString()); msg.setArchitecture(value); break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSkipPreUninstall(value); + break; default: reader.skipField(); break; @@ -1462,6 +1497,13 @@ proto.cc.arduino.cli.commands.v1.PlatformUninstallRequest.serializeBinaryToWrite f ); } + f = message.getSkipPreUninstall(); + if (f) { + writer.writeBool( + 4, + f + ); + } }; @@ -1538,6 +1580,24 @@ proto.cc.arduino.cli.commands.v1.PlatformUninstallRequest.prototype.setArchitect }; +/** + * optional bool skip_pre_uninstall = 4; + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.PlatformUninstallRequest.prototype.getSkipPreUninstall = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.cc.arduino.cli.commands.v1.PlatformUninstallRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.PlatformUninstallRequest.prototype.setSkipPreUninstall = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + @@ -1825,7 +1885,8 @@ proto.cc.arduino.cli.commands.v1.PlatformUpgradeRequest.toObject = function(incl instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), platformPackage: jspb.Message.getFieldWithDefault(msg, 2, ""), architecture: jspb.Message.getFieldWithDefault(msg, 3, ""), - skipPostInstall: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) + skipPostInstall: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + skipPreUninstall: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) }; if (includeInstance) { @@ -1879,6 +1940,10 @@ proto.cc.arduino.cli.commands.v1.PlatformUpgradeRequest.deserializeBinaryFromRea var value = /** @type {boolean} */ (reader.readBool()); msg.setSkipPostInstall(value); break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSkipPreUninstall(value); + break; default: reader.skipField(); break; @@ -1937,6 +2002,13 @@ proto.cc.arduino.cli.commands.v1.PlatformUpgradeRequest.serializeBinaryToWriter f ); } + f = message.getSkipPreUninstall(); + if (f) { + writer.writeBool( + 5, + f + ); + } }; @@ -2031,6 +2103,24 @@ proto.cc.arduino.cli.commands.v1.PlatformUpgradeRequest.prototype.setSkipPostIns }; +/** + * optional bool skip_pre_uninstall = 5; + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.PlatformUpgradeRequest.prototype.getSkipPreUninstall = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.cc.arduino.cli.commands.v1.PlatformUpgradeRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.PlatformUpgradeRequest.prototype.setSkipPreUninstall = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_grpc_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_grpc_pb.js new file mode 100644 index 000000000..97b3a2461 --- /dev/null +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.d.ts similarity index 51% rename from arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.d.ts rename to arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.d.ts index 5a8f0d0f6..622bd778f 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.d.ts @@ -1,5 +1,5 @@ -// package: cc.arduino.cli.debug.v1 -// file: cc/arduino/cli/debug/v1/debug.proto +// package: cc.arduino.cli.commands.v1 +// file: cc/arduino/cli/commands/v1/debug.proto /* tslint:disable */ /* eslint-disable */ @@ -7,13 +7,14 @@ import * as jspb from "google-protobuf"; import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb"; import * as cc_arduino_cli_commands_v1_port_pb from "../../../../../cc/arduino/cli/commands/v1/port_pb"; +import * as google_protobuf_any_pb from "google-protobuf/google/protobuf/any_pb"; export class DebugRequest extends jspb.Message { hasDebugRequest(): boolean; clearDebugRequest(): void; - getDebugRequest(): DebugConfigRequest | undefined; - setDebugRequest(value?: DebugConfigRequest): DebugRequest; + getDebugRequest(): GetDebugConfigRequest | undefined; + setDebugRequest(value?: GetDebugConfigRequest): DebugRequest; getData(): Uint8Array | string; getData_asU8(): Uint8Array; getData_asB64(): string; @@ -33,45 +34,45 @@ export class DebugRequest extends jspb.Message { export namespace DebugRequest { export type AsObject = { - debugRequest?: DebugConfigRequest.AsObject, + debugRequest?: GetDebugConfigRequest.AsObject, data: Uint8Array | string, sendInterrupt: boolean, } } -export class DebugConfigRequest extends jspb.Message { +export class GetDebugConfigRequest extends jspb.Message { hasInstance(): boolean; clearInstance(): void; getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined; - setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): DebugConfigRequest; + setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): GetDebugConfigRequest; getFqbn(): string; - setFqbn(value: string): DebugConfigRequest; + setFqbn(value: string): GetDebugConfigRequest; getSketchPath(): string; - setSketchPath(value: string): DebugConfigRequest; + setSketchPath(value: string): GetDebugConfigRequest; hasPort(): boolean; clearPort(): void; getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined; - setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): DebugConfigRequest; + setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): GetDebugConfigRequest; getInterpreter(): string; - setInterpreter(value: string): DebugConfigRequest; + setInterpreter(value: string): GetDebugConfigRequest; getImportDir(): string; - setImportDir(value: string): DebugConfigRequest; + setImportDir(value: string): GetDebugConfigRequest; getProgrammer(): string; - setProgrammer(value: string): DebugConfigRequest; + setProgrammer(value: string): GetDebugConfigRequest; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DebugConfigRequest.AsObject; - static toObject(includeInstance: boolean, msg: DebugConfigRequest): DebugConfigRequest.AsObject; + toObject(includeInstance?: boolean): GetDebugConfigRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetDebugConfigRequest): GetDebugConfigRequest.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DebugConfigRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DebugConfigRequest; - static deserializeBinaryFromReader(message: DebugConfigRequest, reader: jspb.BinaryReader): DebugConfigRequest; + static serializeBinaryToWriter(message: GetDebugConfigRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDebugConfigRequest; + static deserializeBinaryFromReader(message: GetDebugConfigRequest, reader: jspb.BinaryReader): GetDebugConfigRequest; } -export namespace DebugConfigRequest { +export namespace GetDebugConfigRequest { export type AsObject = { instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject, fqbn: string, @@ -122,11 +123,22 @@ export class GetDebugConfigResponse extends jspb.Message { getServerPath(): string; setServerPath(value: string): GetDebugConfigResponse; - getToolchainConfigurationMap(): jspb.Map; - clearToolchainConfigurationMap(): void; + hasToolchainConfiguration(): boolean; + clearToolchainConfiguration(): void; + getToolchainConfiguration(): google_protobuf_any_pb.Any | undefined; + setToolchainConfiguration(value?: google_protobuf_any_pb.Any): GetDebugConfigResponse; - getServerConfigurationMap(): jspb.Map; - clearServerConfigurationMap(): void; + hasServerConfiguration(): boolean; + clearServerConfiguration(): void; + getServerConfiguration(): google_protobuf_any_pb.Any | undefined; + setServerConfiguration(value?: google_protobuf_any_pb.Any): GetDebugConfigResponse; + + getCustomConfigsMap(): jspb.Map; + clearCustomConfigsMap(): void; + getSvdFile(): string; + setSvdFile(value: string): GetDebugConfigResponse; + getProgrammer(): string; + setProgrammer(value: string): GetDebugConfigResponse; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): GetDebugConfigResponse.AsObject; @@ -146,9 +158,56 @@ export namespace GetDebugConfigResponse { toolchainPrefix: string, server: string, serverPath: string, + toolchainConfiguration?: google_protobuf_any_pb.Any.AsObject, + serverConfiguration?: google_protobuf_any_pb.Any.AsObject, + + customConfigsMap: Array<[string, string]>, + svdFile: string, + programmer: string, + } +} + +export class DebugGCCToolchainConfiguration extends jspb.Message { + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DebugGCCToolchainConfiguration.AsObject; + static toObject(includeInstance: boolean, msg: DebugGCCToolchainConfiguration): DebugGCCToolchainConfiguration.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DebugGCCToolchainConfiguration, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DebugGCCToolchainConfiguration; + static deserializeBinaryFromReader(message: DebugGCCToolchainConfiguration, reader: jspb.BinaryReader): DebugGCCToolchainConfiguration; +} + +export namespace DebugGCCToolchainConfiguration { + export type AsObject = { + } +} - toolchainConfigurationMap: Array<[string, string]>, +export class DebugOpenOCDServerConfiguration extends jspb.Message { + getPath(): string; + setPath(value: string): DebugOpenOCDServerConfiguration; + getScriptsDir(): string; + setScriptsDir(value: string): DebugOpenOCDServerConfiguration; + clearScriptsList(): void; + getScriptsList(): Array; + setScriptsList(value: Array): DebugOpenOCDServerConfiguration; + addScripts(value: string, index?: number): string; - serverConfigurationMap: Array<[string, string]>, + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DebugOpenOCDServerConfiguration.AsObject; + static toObject(includeInstance: boolean, msg: DebugOpenOCDServerConfiguration): DebugOpenOCDServerConfiguration.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DebugOpenOCDServerConfiguration, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DebugOpenOCDServerConfiguration; + static deserializeBinaryFromReader(message: DebugOpenOCDServerConfiguration, reader: jspb.BinaryReader): DebugOpenOCDServerConfiguration; +} + +export namespace DebugOpenOCDServerConfiguration { + export type AsObject = { + path: string, + scriptsDir: string, + scriptsList: Array, } } diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.js new file mode 100644 index 000000000..6e2e0b424 --- /dev/null +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/debug_pb.js @@ -0,0 +1,1725 @@ +// source: cc/arduino/cli/commands/v1/debug.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js'); +goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb); +var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/commands/v1/port_pb.js'); +goog.object.extend(proto, cc_arduino_cli_commands_v1_port_pb); +var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js'); +goog.object.extend(proto, google_protobuf_any_pb); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DebugRequest', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DebugResponse', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest', null, global); +goog.exportSymbol('proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse', null, global); +/** + * 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.v1.DebugRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.DebugRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.DebugRequest.displayName = 'proto.cc.arduino.cli.commands.v1.DebugRequest'; +} +/** + * 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.v1.GetDebugConfigRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.displayName = 'proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest'; +} +/** + * 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.v1.DebugResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.DebugResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.DebugResponse.displayName = 'proto.cc.arduino.cli.commands.v1.DebugResponse'; +} +/** + * 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.v1.GetDebugConfigResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.displayName = 'proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse'; +} +/** + * 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.v1.DebugGCCToolchainConfiguration = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration.displayName = 'proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration'; +} +/** + * 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.v1.DebugOpenOCDServerConfiguration = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.repeatedFields_, null); +}; +goog.inherits(proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.displayName = 'proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration'; +} + + + +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.v1.DebugRequest.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.DebugRequest.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.v1.DebugRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.toObject = function(includeInstance, msg) { + var f, obj = { + debugRequest: (f = msg.getDebugRequest()) && proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.toObject(includeInstance, f), + data: msg.getData_asB64(), + sendInterrupt: 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.v1.DebugRequest} + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.DebugRequest; + return proto.cc.arduino.cli.commands.v1.DebugRequest.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.v1.DebugRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.DebugRequest} + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.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.v1.GetDebugConfigRequest; + reader.readMessage(value,proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.deserializeBinaryFromReader); + msg.setDebugRequest(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSendInterrupt(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.v1.DebugRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.DebugRequest.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.v1.DebugRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDebugRequest(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.serializeBinaryToWriter + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getSendInterrupt(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * optional GetDebugConfigRequest debug_request = 1; + * @return {?proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.prototype.getDebugRequest = function() { + return /** @type{?proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} */ ( + jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest, 1)); +}; + + +/** + * @param {?proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.DebugRequest} returns this +*/ +proto.cc.arduino.cli.commands.v1.DebugRequest.prototype.setDebugRequest = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.DebugRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.prototype.clearDebugRequest = function() { + return this.setDebugRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.prototype.hasDebugRequest = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes data = 2; + * @return {!(string|Uint8Array)} + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes data = 2; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.cc.arduino.cli.commands.v1.DebugRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bool send_interrupt = 3; + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.prototype.getSendInterrupt = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.cc.arduino.cli.commands.v1.DebugRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.DebugRequest.prototype.setSendInterrupt = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, 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.v1.GetDebugConfigRequest.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.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.v1.GetDebugConfigRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.toObject = function(includeInstance, msg) { + var f, obj = { + instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), + fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""), + sketchPath: jspb.Message.getFieldWithDefault(msg, 3, ""), + port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f), + interpreter: jspb.Message.getFieldWithDefault(msg, 5, ""), + importDir: jspb.Message.getFieldWithDefault(msg, 8, ""), + programmer: jspb.Message.getFieldWithDefault(msg, 9, "") + }; + + 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.v1.GetDebugConfigRequest} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest; + return proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.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.v1.GetDebugConfigRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new cc_arduino_cli_commands_v1_common_pb.Instance; + reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Instance.deserializeBinaryFromReader); + msg.setInstance(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setFqbn(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setSketchPath(value); + break; + case 4: + var value = new cc_arduino_cli_commands_v1_port_pb.Port; + reader.readMessage(value,cc_arduino_cli_commands_v1_port_pb.Port.deserializeBinaryFromReader); + msg.setPort(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setInterpreter(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setImportDir(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setProgrammer(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.v1.GetDebugConfigRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.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.v1.GetDebugConfigRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getInstance(); + if (f != null) { + writer.writeMessage( + 1, + f, + cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter + ); + } + f = message.getFqbn(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getSketchPath(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getPort(); + if (f != null) { + writer.writeMessage( + 4, + f, + cc_arduino_cli_commands_v1_port_pb.Port.serializeBinaryToWriter + ); + } + f = message.getInterpreter(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getImportDir(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getProgrammer(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } +}; + + +/** + * optional Instance instance = 1; + * @return {?proto.cc.arduino.cli.commands.v1.Instance} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.getInstance = function() { + return /** @type{?proto.cc.arduino.cli.commands.v1.Instance} */ ( + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.Instance, 1)); +}; + + +/** + * @param {?proto.cc.arduino.cli.commands.v1.Instance|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this +*/ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.setInstance = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.clearInstance = function() { + return this.setInstance(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.hasInstance = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string fqbn = 2; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.getFqbn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.setFqbn = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string sketch_path = 3; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.getSketchPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.setSketchPath = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional Port port = 4; + * @return {?proto.cc.arduino.cli.commands.v1.Port} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.getPort = function() { + return /** @type{?proto.cc.arduino.cli.commands.v1.Port} */ ( + jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_port_pb.Port, 4)); +}; + + +/** + * @param {?proto.cc.arduino.cli.commands.v1.Port|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this +*/ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.setPort = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.clearPort = function() { + return this.setPort(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.hasPort = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional string interpreter = 5; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.getInterpreter = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.setInterpreter = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string import_dir = 8; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.getImportDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.setImportDir = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional string programmer = 9; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.getProgrammer = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigRequest.prototype.setProgrammer = function(value) { + return jspb.Message.setProto3StringField(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.v1.DebugResponse.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.DebugResponse.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.v1.DebugResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.DebugResponse.toObject = function(includeInstance, msg) { + var f, obj = { + data: msg.getData_asB64(), + error: 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.v1.DebugResponse} + */ +proto.cc.arduino.cli.commands.v1.DebugResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.DebugResponse; + return proto.cc.arduino.cli.commands.v1.DebugResponse.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.v1.DebugResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.DebugResponse} + */ +proto.cc.arduino.cli.commands.v1.DebugResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setError(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.v1.DebugResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.DebugResponse.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.v1.DebugResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.DebugResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getError(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional bytes data = 1; + * @return {!(string|Uint8Array)} + */ +proto.cc.arduino.cli.commands.v1.DebugResponse.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes data = 1; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.DebugResponse.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.cc.arduino.cli.commands.v1.DebugResponse.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.cc.arduino.cli.commands.v1.DebugResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.DebugResponse.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string error = 2; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.DebugResponse.prototype.getError = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.DebugResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.DebugResponse.prototype.setError = function(value) { + return jspb.Message.setProto3StringField(this, 2, 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.v1.GetDebugConfigResponse.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.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.v1.GetDebugConfigResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.toObject = function(includeInstance, msg) { + var f, obj = { + executable: jspb.Message.getFieldWithDefault(msg, 1, ""), + toolchain: jspb.Message.getFieldWithDefault(msg, 2, ""), + toolchainPath: jspb.Message.getFieldWithDefault(msg, 3, ""), + toolchainPrefix: jspb.Message.getFieldWithDefault(msg, 4, ""), + server: jspb.Message.getFieldWithDefault(msg, 5, ""), + serverPath: jspb.Message.getFieldWithDefault(msg, 6, ""), + toolchainConfiguration: (f = msg.getToolchainConfiguration()) && google_protobuf_any_pb.Any.toObject(includeInstance, f), + serverConfiguration: (f = msg.getServerConfiguration()) && google_protobuf_any_pb.Any.toObject(includeInstance, f), + customConfigsMap: (f = msg.getCustomConfigsMap()) ? f.toObject(includeInstance, undefined) : [], + svdFile: jspb.Message.getFieldWithDefault(msg, 10, ""), + programmer: jspb.Message.getFieldWithDefault(msg, 11, "") + }; + + 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.v1.GetDebugConfigResponse} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse; + return proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.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.v1.GetDebugConfigResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.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.setExecutable(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setToolchain(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setToolchainPath(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setToolchainPrefix(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setServer(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setServerPath(value); + break; + case 7: + var value = new google_protobuf_any_pb.Any; + reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); + msg.setToolchainConfiguration(value); + break; + case 8: + var value = new google_protobuf_any_pb.Any; + reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); + msg.setServerConfiguration(value); + break; + case 9: + var value = msg.getCustomConfigsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.setSvdFile(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.setProgrammer(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.v1.GetDebugConfigResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.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.v1.GetDebugConfigResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getExecutable(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getToolchain(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getToolchainPath(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getToolchainPrefix(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getServer(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getServerPath(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getToolchainConfiguration(); + if (f != null) { + writer.writeMessage( + 7, + f, + google_protobuf_any_pb.Any.serializeBinaryToWriter + ); + } + f = message.getServerConfiguration(); + if (f != null) { + writer.writeMessage( + 8, + f, + google_protobuf_any_pb.Any.serializeBinaryToWriter + ); + } + f = message.getCustomConfigsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(9, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getSvdFile(); + if (f.length > 0) { + writer.writeString( + 10, + f + ); + } + f = message.getProgrammer(); + if (f.length > 0) { + writer.writeString( + 11, + f + ); + } +}; + + +/** + * optional string executable = 1; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.getExecutable = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.setExecutable = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string toolchain = 2; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.getToolchain = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.setToolchain = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string toolchain_path = 3; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.getToolchainPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.setToolchainPath = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string toolchain_prefix = 4; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.getToolchainPrefix = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.setToolchainPrefix = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string server = 5; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.getServer = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.setServer = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string server_path = 6; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.getServerPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.setServerPath = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional google.protobuf.Any toolchain_configuration = 7; + * @return {?proto.google.protobuf.Any} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.getToolchainConfiguration = function() { + return /** @type{?proto.google.protobuf.Any} */ ( + jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 7)); +}; + + +/** + * @param {?proto.google.protobuf.Any|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this +*/ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.setToolchainConfiguration = function(value) { + return jspb.Message.setWrapperField(this, 7, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.clearToolchainConfiguration = function() { + return this.setToolchainConfiguration(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.hasToolchainConfiguration = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional google.protobuf.Any server_configuration = 8; + * @return {?proto.google.protobuf.Any} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.getServerConfiguration = function() { + return /** @type{?proto.google.protobuf.Any} */ ( + jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 8)); +}; + + +/** + * @param {?proto.google.protobuf.Any|undefined} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this +*/ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.setServerConfiguration = function(value) { + return jspb.Message.setWrapperField(this, 8, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.clearServerConfiguration = function() { + return this.setServerConfiguration(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.hasServerConfiguration = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +/** + * map custom_configs = 9; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.getCustomConfigsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 9, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.clearCustomConfigsMap = function() { + this.getCustomConfigsMap().clear(); + return this;}; + + +/** + * optional string svd_file = 10; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.getSvdFile = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.setSvdFile = function(value) { + return jspb.Message.setProto3StringField(this, 10, value); +}; + + +/** + * optional string programmer = 11; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.getProgrammer = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse} returns this + */ +proto.cc.arduino.cli.commands.v1.GetDebugConfigResponse.prototype.setProgrammer = function(value) { + return jspb.Message.setProto3StringField(this, 11, 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.v1.DebugGCCToolchainConfiguration.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration.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.v1.DebugGCCToolchainConfiguration} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + 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.v1.DebugGCCToolchainConfiguration} + */ +proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration; + return proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration.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.v1.DebugGCCToolchainConfiguration} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration} + */ +proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration.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.v1.DebugGCCToolchainConfiguration} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.repeatedFields_ = [3]; + + + +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.v1.DebugOpenOCDServerConfiguration.prototype.toObject = function(opt_includeInstance) { + return proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.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.v1.DebugOpenOCDServerConfiguration} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.toObject = function(includeInstance, msg) { + var f, obj = { + path: jspb.Message.getFieldWithDefault(msg, 1, ""), + scriptsDir: jspb.Message.getFieldWithDefault(msg, 2, ""), + scriptsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f + }; + + 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.v1.DebugOpenOCDServerConfiguration} + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration; + return proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.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.v1.DebugOpenOCDServerConfiguration} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration} + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.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.setPath(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setScriptsDir(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addScripts(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.v1.DebugOpenOCDServerConfiguration.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.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.v1.DebugOpenOCDServerConfiguration} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPath(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getScriptsDir(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getScriptsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } +}; + + +/** + * optional string path = 1; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.prototype.getPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration} returns this + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.prototype.setPath = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string scripts_dir = 2; + * @return {string} + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.prototype.getScriptsDir = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration} returns this + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.prototype.setScriptsDir = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated string scripts = 3; + * @return {!Array} + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.prototype.getScriptsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration} returns this + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.prototype.setScriptsList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration} returns this + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.prototype.addScripts = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration} returns this + */ +proto.cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration.prototype.clearScriptsList = function() { + return this.setScriptsList([]); +}; + + +goog.object.extend(exports, proto.cc.arduino.cli.commands.v1); diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.d.ts deleted file mode 100644 index a5e384a95..000000000 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -// package: cc.arduino.cli.debug.v1 -// file: cc/arduino/cli/debug/v1/debug.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as grpc from "@grpc/grpc-js"; -import * as cc_arduino_cli_debug_v1_debug_pb from "../../../../../cc/arduino/cli/debug/v1/debug_pb"; -import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb"; -import * as cc_arduino_cli_commands_v1_port_pb from "../../../../../cc/arduino/cli/commands/v1/port_pb"; - -interface IDebugServiceService extends grpc.ServiceDefinition { - debug: IDebugServiceService_IDebug; - getDebugConfig: IDebugServiceService_IGetDebugConfig; -} - -interface IDebugServiceService_IDebug extends grpc.MethodDefinition { - path: "/cc.arduino.cli.debug.v1.DebugService/Debug"; - requestStream: true; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IDebugServiceService_IGetDebugConfig extends grpc.MethodDefinition { - path: "/cc.arduino.cli.debug.v1.DebugService/GetDebugConfig"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} - -export const DebugServiceService: IDebugServiceService; - -export interface IDebugServiceServer extends grpc.UntypedServiceImplementation { - debug: grpc.handleBidiStreamingCall; - getDebugConfig: grpc.handleUnaryCall; -} - -export interface IDebugServiceClient { - debug(): grpc.ClientDuplexStream; - debug(options: Partial): grpc.ClientDuplexStream; - debug(metadata: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; - getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; - getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; - getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; -} - -export class DebugServiceClient extends grpc.Client implements IDebugServiceClient { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); - public debug(options?: Partial): grpc.ClientDuplexStream; - public debug(metadata?: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; - public getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; - public getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; - public getDebugConfig(request: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall; -} diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.js deleted file mode 100644 index 829ca77d3..000000000 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_grpc_pb.js +++ /dev/null @@ -1,95 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// Original file comments: -// This file is part of arduino-cli. -// -// Copyright 2020 ARDUINO SA (http://www.arduino.cc/) -// -// This software is released under the GNU General Public License version 3, -// which covers the main part of arduino-cli. -// The terms of this license can be found at: -// https://www.gnu.org/licenses/gpl-3.0.en.html -// -// You can be released from the requirements of the above licenses by purchasing -// a commercial license. Buying such a license is mandatory if you want to -// modify or otherwise use the software for commercial activities involving the -// Arduino software without disclosing the source code of your own applications. -// To purchase a commercial license, send an email to license@arduino.cc. -// -'use strict'; -var cc_arduino_cli_debug_v1_debug_pb = require('../../../../../cc/arduino/cli/debug/v1/debug_pb.js'); -var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js'); -var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/commands/v1/port_pb.js'); - -function serialize_cc_arduino_cli_debug_v1_DebugConfigRequest(arg) { - if (!(arg instanceof cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest)) { - throw new Error('Expected argument of type cc.arduino.cli.debug.v1.DebugConfigRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_cc_arduino_cli_debug_v1_DebugConfigRequest(buffer_arg) { - return cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_cc_arduino_cli_debug_v1_DebugRequest(arg) { - if (!(arg instanceof cc_arduino_cli_debug_v1_debug_pb.DebugRequest)) { - throw new Error('Expected argument of type cc.arduino.cli.debug.v1.DebugRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_cc_arduino_cli_debug_v1_DebugRequest(buffer_arg) { - return cc_arduino_cli_debug_v1_debug_pb.DebugRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_cc_arduino_cli_debug_v1_DebugResponse(arg) { - if (!(arg instanceof cc_arduino_cli_debug_v1_debug_pb.DebugResponse)) { - throw new Error('Expected argument of type cc.arduino.cli.debug.v1.DebugResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_cc_arduino_cli_debug_v1_DebugResponse(buffer_arg) { - return cc_arduino_cli_debug_v1_debug_pb.DebugResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_cc_arduino_cli_debug_v1_GetDebugConfigResponse(arg) { - if (!(arg instanceof cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse)) { - throw new Error('Expected argument of type cc.arduino.cli.debug.v1.GetDebugConfigResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_cc_arduino_cli_debug_v1_GetDebugConfigResponse(buffer_arg) { - return cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -// DebugService abstracts a debug Session usage -var DebugServiceService = exports['cc.arduino.cli.debug.v1.DebugService'] = { - // Start a debug session and communicate with the debugger tool. -debug: { - path: '/cc.arduino.cli.debug.v1.DebugService/Debug', - requestStream: true, - responseStream: true, - requestType: cc_arduino_cli_debug_v1_debug_pb.DebugRequest, - responseType: cc_arduino_cli_debug_v1_debug_pb.DebugResponse, - requestSerialize: serialize_cc_arduino_cli_debug_v1_DebugRequest, - requestDeserialize: deserialize_cc_arduino_cli_debug_v1_DebugRequest, - responseSerialize: serialize_cc_arduino_cli_debug_v1_DebugResponse, - responseDeserialize: deserialize_cc_arduino_cli_debug_v1_DebugResponse, - }, - getDebugConfig: { - path: '/cc.arduino.cli.debug.v1.DebugService/GetDebugConfig', - requestStream: false, - responseStream: false, - requestType: cc_arduino_cli_debug_v1_debug_pb.DebugConfigRequest, - responseType: cc_arduino_cli_debug_v1_debug_pb.GetDebugConfigResponse, - requestSerialize: serialize_cc_arduino_cli_debug_v1_DebugConfigRequest, - requestDeserialize: deserialize_cc_arduino_cli_debug_v1_DebugConfigRequest, - responseSerialize: serialize_cc_arduino_cli_debug_v1_GetDebugConfigResponse, - responseDeserialize: deserialize_cc_arduino_cli_debug_v1_GetDebugConfigResponse, - }, -}; - diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.js deleted file mode 100644 index 136919afe..000000000 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/debug/v1/debug_pb.js +++ /dev/null @@ -1,1233 +0,0 @@ -// source: cc/arduino/cli/debug/v1/debug.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = (function() { - if (this) { return this; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - if (typeof self !== 'undefined') { return self; } - return Function('return this')(); -}.call(null)); - -var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js'); -goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb); -var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/commands/v1/port_pb.js'); -goog.object.extend(proto, cc_arduino_cli_commands_v1_port_pb); -goog.exportSymbol('proto.cc.arduino.cli.debug.v1.DebugConfigRequest', null, global); -goog.exportSymbol('proto.cc.arduino.cli.debug.v1.DebugRequest', null, global); -goog.exportSymbol('proto.cc.arduino.cli.debug.v1.DebugResponse', null, global); -goog.exportSymbol('proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse', null, global); -/** - * 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.debug.v1.DebugRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.cc.arduino.cli.debug.v1.DebugRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.cc.arduino.cli.debug.v1.DebugRequest.displayName = 'proto.cc.arduino.cli.debug.v1.DebugRequest'; -} -/** - * 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.debug.v1.DebugConfigRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.cc.arduino.cli.debug.v1.DebugConfigRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.cc.arduino.cli.debug.v1.DebugConfigRequest.displayName = 'proto.cc.arduino.cli.debug.v1.DebugConfigRequest'; -} -/** - * 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.debug.v1.DebugResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.cc.arduino.cli.debug.v1.DebugResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.cc.arduino.cli.debug.v1.DebugResponse.displayName = 'proto.cc.arduino.cli.debug.v1.DebugResponse'; -} -/** - * 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.debug.v1.GetDebugConfigResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.displayName = 'proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse'; -} - - - -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.debug.v1.DebugRequest.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.debug.v1.DebugRequest.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.debug.v1.DebugRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.toObject = function(includeInstance, msg) { - var f, obj = { - debugRequest: (f = msg.getDebugRequest()) && proto.cc.arduino.cli.debug.v1.DebugConfigRequest.toObject(includeInstance, f), - data: msg.getData_asB64(), - sendInterrupt: 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.debug.v1.DebugRequest} - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.debug.v1.DebugRequest; - return proto.cc.arduino.cli.debug.v1.DebugRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.cc.arduino.cli.debug.v1.DebugRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.debug.v1.DebugRequest} - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.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.debug.v1.DebugConfigRequest; - reader.readMessage(value,proto.cc.arduino.cli.debug.v1.DebugConfigRequest.deserializeBinaryFromReader); - msg.setDebugRequest(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setData(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSendInterrupt(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.debug.v1.DebugRequest.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.debug.v1.DebugRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDebugRequest(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.cc.arduino.cli.debug.v1.DebugConfigRequest.serializeBinaryToWriter - ); - } - f = message.getData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } - f = message.getSendInterrupt(); - if (f) { - writer.writeBool( - 3, - f - ); - } -}; - - -/** - * optional DebugConfigRequest debug_request = 1; - * @return {?proto.cc.arduino.cli.debug.v1.DebugConfigRequest} - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.prototype.getDebugRequest = function() { - return /** @type{?proto.cc.arduino.cli.debug.v1.DebugConfigRequest} */ ( - jspb.Message.getWrapperField(this, proto.cc.arduino.cli.debug.v1.DebugConfigRequest, 1)); -}; - - -/** - * @param {?proto.cc.arduino.cli.debug.v1.DebugConfigRequest|undefined} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugRequest} returns this -*/ -proto.cc.arduino.cli.debug.v1.DebugRequest.prototype.setDebugRequest = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.cc.arduino.cli.debug.v1.DebugRequest} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.prototype.clearDebugRequest = function() { - return this.setDebugRequest(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.prototype.hasDebugRequest = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional bytes data = 2; - * @return {!(string|Uint8Array)} - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.prototype.getData = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * optional bytes data = 2; - * This is a type-conversion wrapper around `getData()` - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.prototype.getData_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getData())); -}; - - -/** - * optional bytes data = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getData()` - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugRequest} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); -}; - - -/** - * optional bool send_interrupt = 3; - * @return {boolean} - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.prototype.getSendInterrupt = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugRequest} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugRequest.prototype.setSendInterrupt = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, 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.debug.v1.DebugConfigRequest.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.debug.v1.DebugConfigRequest.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.debug.v1.DebugConfigRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.toObject = function(includeInstance, msg) { - var f, obj = { - instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f), - fqbn: jspb.Message.getFieldWithDefault(msg, 2, ""), - sketchPath: jspb.Message.getFieldWithDefault(msg, 3, ""), - port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f), - interpreter: jspb.Message.getFieldWithDefault(msg, 5, ""), - importDir: jspb.Message.getFieldWithDefault(msg, 8, ""), - programmer: jspb.Message.getFieldWithDefault(msg, 9, "") - }; - - 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.debug.v1.DebugConfigRequest} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.debug.v1.DebugConfigRequest; - return proto.cc.arduino.cli.debug.v1.DebugConfigRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new cc_arduino_cli_commands_v1_common_pb.Instance; - reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Instance.deserializeBinaryFromReader); - msg.setInstance(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setFqbn(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setSketchPath(value); - break; - case 4: - var value = new cc_arduino_cli_commands_v1_port_pb.Port; - reader.readMessage(value,cc_arduino_cli_commands_v1_port_pb.Port.deserializeBinaryFromReader); - msg.setPort(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setInterpreter(value); - break; - case 8: - var value = /** @type {string} */ (reader.readString()); - msg.setImportDir(value); - break; - case 9: - var value = /** @type {string} */ (reader.readString()); - msg.setProgrammer(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.debug.v1.DebugConfigRequest.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.debug.v1.DebugConfigRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getInstance(); - if (f != null) { - writer.writeMessage( - 1, - f, - cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter - ); - } - f = message.getFqbn(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getSketchPath(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getPort(); - if (f != null) { - writer.writeMessage( - 4, - f, - cc_arduino_cli_commands_v1_port_pb.Port.serializeBinaryToWriter - ); - } - f = message.getInterpreter(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } - f = message.getImportDir(); - if (f.length > 0) { - writer.writeString( - 8, - f - ); - } - f = message.getProgrammer(); - if (f.length > 0) { - writer.writeString( - 9, - f - ); - } -}; - - -/** - * optional cc.arduino.cli.commands.v1.Instance instance = 1; - * @return {?proto.cc.arduino.cli.commands.v1.Instance} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.getInstance = function() { - return /** @type{?proto.cc.arduino.cli.commands.v1.Instance} */ ( - jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.Instance, 1)); -}; - - -/** - * @param {?proto.cc.arduino.cli.commands.v1.Instance|undefined} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this -*/ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setInstance = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.clearInstance = function() { - return this.setInstance(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.hasInstance = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string fqbn = 2; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.getFqbn = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setFqbn = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string sketch_path = 3; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.getSketchPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setSketchPath = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional cc.arduino.cli.commands.v1.Port port = 4; - * @return {?proto.cc.arduino.cli.commands.v1.Port} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.getPort = function() { - return /** @type{?proto.cc.arduino.cli.commands.v1.Port} */ ( - jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_port_pb.Port, 4)); -}; - - -/** - * @param {?proto.cc.arduino.cli.commands.v1.Port|undefined} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this -*/ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setPort = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.clearPort = function() { - return this.setPort(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.hasPort = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional string interpreter = 5; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.getInterpreter = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setInterpreter = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); -}; - - -/** - * optional string import_dir = 8; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.getImportDir = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setImportDir = function(value) { - return jspb.Message.setProto3StringField(this, 8, value); -}; - - -/** - * optional string programmer = 9; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.getProgrammer = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugConfigRequest} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugConfigRequest.prototype.setProgrammer = function(value) { - return jspb.Message.setProto3StringField(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.debug.v1.DebugResponse.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.debug.v1.DebugResponse.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.debug.v1.DebugResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.debug.v1.DebugResponse.toObject = function(includeInstance, msg) { - var f, obj = { - data: msg.getData_asB64(), - error: 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.debug.v1.DebugResponse} - */ -proto.cc.arduino.cli.debug.v1.DebugResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.debug.v1.DebugResponse; - return proto.cc.arduino.cli.debug.v1.DebugResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.cc.arduino.cli.debug.v1.DebugResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.debug.v1.DebugResponse} - */ -proto.cc.arduino.cli.debug.v1.DebugResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setData(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setError(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.debug.v1.DebugResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.debug.v1.DebugResponse.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.debug.v1.DebugResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.debug.v1.DebugResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getError(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional bytes data = 1; - * @return {!(string|Uint8Array)} - */ -proto.cc.arduino.cli.debug.v1.DebugResponse.prototype.getData = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes data = 1; - * This is a type-conversion wrapper around `getData()` - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.DebugResponse.prototype.getData_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getData())); -}; - - -/** - * optional bytes data = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getData()` - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.debug.v1.DebugResponse.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugResponse} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugResponse.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional string error = 2; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.DebugResponse.prototype.getError = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.DebugResponse} returns this - */ -proto.cc.arduino.cli.debug.v1.DebugResponse.prototype.setError = function(value) { - return jspb.Message.setProto3StringField(this, 2, 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.debug.v1.GetDebugConfigResponse.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.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.debug.v1.GetDebugConfigResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.toObject = function(includeInstance, msg) { - var f, obj = { - executable: jspb.Message.getFieldWithDefault(msg, 1, ""), - toolchain: jspb.Message.getFieldWithDefault(msg, 2, ""), - toolchainPath: jspb.Message.getFieldWithDefault(msg, 3, ""), - toolchainPrefix: jspb.Message.getFieldWithDefault(msg, 4, ""), - server: jspb.Message.getFieldWithDefault(msg, 5, ""), - serverPath: jspb.Message.getFieldWithDefault(msg, 6, ""), - toolchainConfigurationMap: (f = msg.getToolchainConfigurationMap()) ? f.toObject(includeInstance, undefined) : [], - serverConfigurationMap: (f = msg.getServerConfigurationMap()) ? f.toObject(includeInstance, undefined) : [] - }; - - 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.debug.v1.GetDebugConfigResponse} - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse; - return proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse} - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.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.setExecutable(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setToolchain(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setToolchainPath(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setToolchainPrefix(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setServer(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setServerPath(value); - break; - case 7: - var value = msg.getToolchainConfigurationMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - case 8: - var value = msg.getServerConfigurationMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.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.debug.v1.GetDebugConfigResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getExecutable(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getToolchain(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getToolchainPath(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getToolchainPrefix(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getServer(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } - f = message.getServerPath(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } - f = message.getToolchainConfigurationMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } - f = message.getServerConfigurationMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(8, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * optional string executable = 1; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.getExecutable = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse} returns this - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.setExecutable = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string toolchain = 2; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.getToolchain = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse} returns this - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.setToolchain = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string toolchain_path = 3; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.getToolchainPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse} returns this - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.setToolchainPath = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional string toolchain_prefix = 4; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.getToolchainPrefix = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse} returns this - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.setToolchainPrefix = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * optional string server = 5; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.getServer = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse} returns this - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.setServer = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); -}; - - -/** - * optional string server_path = 6; - * @return {string} - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.getServerPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse} returns this - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.setServerPath = function(value) { - return jspb.Message.setProto3StringField(this, 6, value); -}; - - -/** - * map toolchain_configuration = 7; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.getToolchainConfigurationMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 7, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse} returns this - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.clearToolchainConfigurationMap = function() { - this.getToolchainConfigurationMap().clear(); - return this;}; - - -/** - * map server_configuration = 8; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.getServerConfigurationMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 8, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse} returns this - */ -proto.cc.arduino.cli.debug.v1.GetDebugConfigResponse.prototype.clearServerConfigurationMap = function() { - this.getServerConfigurationMap().clear(); - return this;}; - - -goog.object.extend(exports, proto.cc.arduino.cli.debug.v1); diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_grpc_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_grpc_pb.d.ts deleted file mode 100644 index 981a1da92..000000000 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_grpc_pb.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -// package: cc.arduino.cli.monitor.v1 -// file: cc/arduino/cli/monitor/v1/monitor.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as grpc from "@grpc/grpc-js"; -import {handleClientStreamingCall} from "@grpc/grpc-js/build/src/server-call"; -import * as cc_arduino_cli_monitor_v1_monitor_pb from "../../../../../cc/arduino/cli/monitor/v1/monitor_pb"; -import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; - -interface IMonitorServiceService extends grpc.ServiceDefinition { - streamingOpen: IMonitorServiceService_IStreamingOpen; -} - -interface IMonitorServiceService_IStreamingOpen extends grpc.MethodDefinition { - path: "/cc.arduino.cli.monitor.v1.MonitorService/StreamingOpen"; - requestStream: true; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} - -export const MonitorServiceService: IMonitorServiceService; - -export interface IMonitorServiceServer { - streamingOpen: grpc.handleBidiStreamingCall; -} - -export interface IMonitorServiceClient { - streamingOpen(): grpc.ClientDuplexStream; - streamingOpen(options: Partial): grpc.ClientDuplexStream; - streamingOpen(metadata: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; -} - -export class MonitorServiceClient extends grpc.Client implements IMonitorServiceClient { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); - public streamingOpen(options?: Partial): grpc.ClientDuplexStream; - public streamingOpen(metadata?: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; -} diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_grpc_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_grpc_pb.js deleted file mode 100644 index f20982617..000000000 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_grpc_pb.js +++ /dev/null @@ -1,65 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// Original file comments: -// This file is part of arduino-cli. -// -// Copyright 2020 ARDUINO SA (http://www.arduino.cc/) -// -// This software is released under the GNU General Public License version 3, -// which covers the main part of arduino-cli. -// The terms of this license can be found at: -// https://www.gnu.org/licenses/gpl-3.0.en.html -// -// You can be released from the requirements of the above licenses by purchasing -// a commercial license. Buying such a license is mandatory if you want to -// modify or otherwise use the software for commercial activities involving the -// Arduino software without disclosing the source code of your own applications. -// To purchase a commercial license, send an email to license@arduino.cc. -// -'use strict'; -var cc_arduino_cli_monitor_v1_monitor_pb = require('../../../../../cc/arduino/cli/monitor/v1/monitor_pb.js'); -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); - -function serialize_cc_arduino_cli_monitor_v1_StreamingOpenRequest(arg) { - if (!(arg instanceof cc_arduino_cli_monitor_v1_monitor_pb.StreamingOpenRequest)) { - throw new Error('Expected argument of type cc.arduino.cli.monitor.v1.StreamingOpenRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_cc_arduino_cli_monitor_v1_StreamingOpenRequest(buffer_arg) { - return cc_arduino_cli_monitor_v1_monitor_pb.StreamingOpenRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_cc_arduino_cli_monitor_v1_StreamingOpenResponse(arg) { - if (!(arg instanceof cc_arduino_cli_monitor_v1_monitor_pb.StreamingOpenResponse)) { - throw new Error('Expected argument of type cc.arduino.cli.monitor.v1.StreamingOpenResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_cc_arduino_cli_monitor_v1_StreamingOpenResponse(buffer_arg) { - return cc_arduino_cli_monitor_v1_monitor_pb.StreamingOpenResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -// MonitorService provides services for boards monitor. -// DEPRECATION WARNING: MonitorService is deprecated and will be removed in a -// future release. Use ArduinoCoreService.Monitor and -// ArduinoCoreService.EnumerateMonitorPortSettings instead. -var MonitorServiceService = exports['cc.arduino.cli.monitor.v1.MonitorService'] = { - // Open a bidirectional monitor stream. This can be used to implement -// something similar to the Arduino IDE's Serial Monitor. -streamingOpen: { - path: '/cc.arduino.cli.monitor.v1.MonitorService/StreamingOpen', - requestStream: true, - responseStream: true, - requestType: cc_arduino_cli_monitor_v1_monitor_pb.StreamingOpenRequest, - responseType: cc_arduino_cli_monitor_v1_monitor_pb.StreamingOpenResponse, - requestSerialize: serialize_cc_arduino_cli_monitor_v1_StreamingOpenRequest, - requestDeserialize: deserialize_cc_arduino_cli_monitor_v1_StreamingOpenRequest, - responseSerialize: serialize_cc_arduino_cli_monitor_v1_StreamingOpenResponse, - responseDeserialize: deserialize_cc_arduino_cli_monitor_v1_StreamingOpenResponse, - }, -}; - diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_pb.d.ts deleted file mode 100644 index 9d158dd24..000000000 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_pb.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -// package: cc.arduino.cli.monitor.v1 -// file: cc/arduino/cli/monitor/v1/monitor.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as jspb from "google-protobuf"; -import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; - -export class StreamingOpenRequest extends jspb.Message { - - hasConfig(): boolean; - clearConfig(): void; - getConfig(): MonitorConfig | undefined; - setConfig(value?: MonitorConfig): StreamingOpenRequest; - - - hasData(): boolean; - clearData(): void; - getData(): Uint8Array | string; - getData_asU8(): Uint8Array; - getData_asB64(): string; - setData(value: Uint8Array | string): StreamingOpenRequest; - - - hasRecvAcknowledge(): boolean; - clearRecvAcknowledge(): void; - getRecvAcknowledge(): number; - setRecvAcknowledge(value: number): StreamingOpenRequest; - - - getContentCase(): StreamingOpenRequest.ContentCase; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): StreamingOpenRequest.AsObject; - static toObject(includeInstance: boolean, msg: StreamingOpenRequest): StreamingOpenRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: StreamingOpenRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): StreamingOpenRequest; - static deserializeBinaryFromReader(message: StreamingOpenRequest, reader: jspb.BinaryReader): StreamingOpenRequest; -} - -export namespace StreamingOpenRequest { - export type AsObject = { - config?: MonitorConfig.AsObject, - data: Uint8Array | string, - recvAcknowledge: number, - } - - export enum ContentCase { - CONTENT_NOT_SET = 0, - - CONFIG = 1, - - DATA = 2, - - RECV_ACKNOWLEDGE = 3, - - } - -} - -export class MonitorConfig extends jspb.Message { - getTarget(): string; - setTarget(value: string): MonitorConfig; - - getType(): MonitorConfig.TargetType; - setType(value: MonitorConfig.TargetType): MonitorConfig; - - - hasAdditionalConfig(): boolean; - clearAdditionalConfig(): void; - getAdditionalConfig(): google_protobuf_struct_pb.Struct | undefined; - setAdditionalConfig(value?: google_protobuf_struct_pb.Struct): MonitorConfig; - - getRecvRateLimitBuffer(): number; - setRecvRateLimitBuffer(value: number): MonitorConfig; - - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): MonitorConfig.AsObject; - static toObject(includeInstance: boolean, msg: MonitorConfig): MonitorConfig.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: MonitorConfig, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): MonitorConfig; - static deserializeBinaryFromReader(message: MonitorConfig, reader: jspb.BinaryReader): MonitorConfig; -} - -export namespace MonitorConfig { - export type AsObject = { - target: string, - type: MonitorConfig.TargetType, - additionalConfig?: google_protobuf_struct_pb.Struct.AsObject, - recvRateLimitBuffer: number, - } - - export enum TargetType { - TARGET_TYPE_SERIAL = 0, - TARGET_TYPE_NULL = 99, - } - -} - -export class StreamingOpenResponse extends jspb.Message { - getData(): Uint8Array | string; - getData_asU8(): Uint8Array; - getData_asB64(): string; - setData(value: Uint8Array | string): StreamingOpenResponse; - - getDropped(): number; - setDropped(value: number): StreamingOpenResponse; - - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): StreamingOpenResponse.AsObject; - static toObject(includeInstance: boolean, msg: StreamingOpenResponse): StreamingOpenResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: StreamingOpenResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): StreamingOpenResponse; - static deserializeBinaryFromReader(message: StreamingOpenResponse, reader: jspb.BinaryReader): StreamingOpenResponse; -} - -export namespace StreamingOpenResponse { - export type AsObject = { - data: Uint8Array | string, - dropped: number, - } -} diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_pb.js deleted file mode 100644 index 4546fe982..000000000 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/monitor/v1/monitor_pb.js +++ /dev/null @@ -1,819 +0,0 @@ -// source: cc/arduino/cli/monitor/v1/monitor.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); -goog.object.extend(proto, google_protobuf_struct_pb); -goog.exportSymbol('proto.cc.arduino.cli.monitor.v1.MonitorConfig', null, global); -goog.exportSymbol('proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType', null, global); -goog.exportSymbol('proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest', null, global); -goog.exportSymbol('proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.ContentCase', null, global); -goog.exportSymbol('proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse', null, global); -/** - * 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.monitor.v1.StreamingOpenRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_); -}; -goog.inherits(proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.displayName = 'proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest'; -} -/** - * 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.monitor.v1.MonitorConfig = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.cc.arduino.cli.monitor.v1.MonitorConfig, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.cc.arduino.cli.monitor.v1.MonitorConfig.displayName = 'proto.cc.arduino.cli.monitor.v1.MonitorConfig'; -} -/** - * 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.monitor.v1.StreamingOpenResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.displayName = 'proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse'; -} - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_ = [[1,2,3]]; - -/** - * @enum {number} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.ContentCase = { - CONTENT_NOT_SET: 0, - CONFIG: 1, - DATA: 2, - RECV_ACKNOWLEDGE: 3 -}; - -/** - * @return {proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.ContentCase} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getContentCase = function() { - return /** @type {proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.ContentCase} */(jspb.Message.computeOneofCase(this, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0])); -}; - - - -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.monitor.v1.StreamingOpenRequest.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.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.monitor.v1.StreamingOpenRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.toObject = function(includeInstance, msg) { - var f, obj = { - config: (f = msg.getConfig()) && proto.cc.arduino.cli.monitor.v1.MonitorConfig.toObject(includeInstance, f), - data: msg.getData_asB64(), - recvAcknowledge: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - - 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.monitor.v1.StreamingOpenRequest} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest; - return proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.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.monitor.v1.MonitorConfig; - reader.readMessage(value,proto.cc.arduino.cli.monitor.v1.MonitorConfig.deserializeBinaryFromReader); - msg.setConfig(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setData(value); - break; - case 3: - var value = /** @type {number} */ (reader.readInt32()); - msg.setRecvAcknowledge(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.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.monitor.v1.StreamingOpenRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getConfig(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.cc.arduino.cli.monitor.v1.MonitorConfig.serializeBinaryToWriter - ); - } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeBytes( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeInt32( - 3, - f - ); - } -}; - - -/** - * optional MonitorConfig config = 1; - * @return {?proto.cc.arduino.cli.monitor.v1.MonitorConfig} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getConfig = function() { - return /** @type{?proto.cc.arduino.cli.monitor.v1.MonitorConfig} */ ( - jspb.Message.getWrapperField(this, proto.cc.arduino.cli.monitor.v1.MonitorConfig, 1)); -}; - - -/** - * @param {?proto.cc.arduino.cli.monitor.v1.MonitorConfig|undefined} value - * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this -*/ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.setConfig = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.clearConfig = function() { - return this.setConfig(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.hasConfig = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional bytes data = 2; - * @return {!(string|Uint8Array)} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getData = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * optional bytes data = 2; - * This is a type-conversion wrapper around `getData()` - * @return {string} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getData_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getData())); -}; - - -/** - * optional bytes data = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getData()` - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.setData = function(value) { - return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.clearData = function() { - return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.hasData = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional int32 recv_acknowledge = 3; - * @return {number} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.getRecvAcknowledge = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.setRecvAcknowledge = function(value) { - return jspb.Message.setOneofField(this, 3, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest} returns this - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.clearRecvAcknowledge = function() { - return jspb.Message.setOneofField(this, 3, proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenRequest.prototype.hasRecvAcknowledge = function() { - return jspb.Message.getField(this, 3) != 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.monitor.v1.MonitorConfig.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.monitor.v1.MonitorConfig.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.monitor.v1.MonitorConfig} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.toObject = function(includeInstance, msg) { - var f, obj = { - target: jspb.Message.getFieldWithDefault(msg, 1, ""), - type: jspb.Message.getFieldWithDefault(msg, 2, 0), - additionalConfig: (f = msg.getAdditionalConfig()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), - recvRateLimitBuffer: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; - - 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.monitor.v1.MonitorConfig} - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.monitor.v1.MonitorConfig; - return proto.cc.arduino.cli.monitor.v1.MonitorConfig.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.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.setTarget(value); - break; - case 2: - var value = /** @type {!proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType} */ (reader.readEnum()); - msg.setType(value); - break; - case 3: - var value = new google_protobuf_struct_pb.Struct; - reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); - msg.setAdditionalConfig(value); - break; - case 4: - var value = /** @type {number} */ (reader.readInt32()); - msg.setRecvRateLimitBuffer(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.monitor.v1.MonitorConfig.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.monitor.v1.MonitorConfig} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTarget(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } - f = message.getAdditionalConfig(); - if (f != null) { - writer.writeMessage( - 3, - f, - google_protobuf_struct_pb.Struct.serializeBinaryToWriter - ); - } - f = message.getRecvRateLimitBuffer(); - if (f !== 0) { - writer.writeInt32( - 4, - f - ); - } -}; - - -/** - * @enum {number} - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType = { - TARGET_TYPE_SERIAL: 0, - TARGET_TYPE_NULL: 99 -}; - -/** - * optional string target = 1; - * @return {string} - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.getTarget = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} returns this - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.setTarget = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional TargetType type = 2; - * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType} - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.getType = function() { - return /** @type {!proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {!proto.cc.arduino.cli.monitor.v1.MonitorConfig.TargetType} value - * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} returns this - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); -}; - - -/** - * optional google.protobuf.Struct additional_config = 3; - * @return {?proto.google.protobuf.Struct} - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.getAdditionalConfig = function() { - return /** @type{?proto.google.protobuf.Struct} */ ( - jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); -}; - - -/** - * @param {?proto.google.protobuf.Struct|undefined} value - * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} returns this -*/ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.setAdditionalConfig = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} returns this - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.clearAdditionalConfig = function() { - return this.setAdditionalConfig(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.hasAdditionalConfig = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional int32 recv_rate_limit_buffer = 4; - * @return {number} - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.getRecvRateLimitBuffer = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.cc.arduino.cli.monitor.v1.MonitorConfig} returns this - */ -proto.cc.arduino.cli.monitor.v1.MonitorConfig.prototype.setRecvRateLimitBuffer = function(value) { - return jspb.Message.setProto3IntField(this, 4, 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.monitor.v1.StreamingOpenResponse.prototype.toObject = function(opt_includeInstance) { - return proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.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.monitor.v1.StreamingOpenResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.toObject = function(includeInstance, msg) { - var f, obj = { - data: msg.getData_asB64(), - dropped: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - - 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.monitor.v1.StreamingOpenResponse} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse; - return proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setData(value); - break; - case 2: - var value = /** @type {number} */ (reader.readInt32()); - msg.setDropped(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.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.monitor.v1.StreamingOpenResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getDropped(); - if (f !== 0) { - writer.writeInt32( - 2, - f - ); - } -}; - - -/** - * optional bytes data = 1; - * @return {!(string|Uint8Array)} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.getData = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes data = 1; - * This is a type-conversion wrapper around `getData()` - * @return {string} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.getData_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getData())); -}; - - -/** - * optional bytes data = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getData()` - * @return {!Uint8Array} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse} returns this - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional int32 dropped = 2; - * @return {number} - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.getDropped = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse} returns this - */ -proto.cc.arduino.cli.monitor.v1.StreamingOpenResponse.prototype.setDropped = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - - -goog.object.extend(exports, proto.cc.arduino.cli.monitor.v1); From 33dd2a740b5c39750fd57687a6dd4ebb2fded06f Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Thu, 26 Oct 2023 16:20:50 +0200 Subject: [PATCH 5/6] chore: use `0.7.5` Arduino LS Signed-off-by: Akos Kitta --- arduino-ide-extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json index a8715a45d..8e960e0ea 100644 --- a/arduino-ide-extension/package.json +++ b/arduino-ide-extension/package.json @@ -175,7 +175,7 @@ "version": "2.4.1" }, "arduino-language-server": { - "version": "0.7.4" + "version": "0.7.5" }, "clangd": { "version": "14.0.0" From c62275e5bfb55aeded4e0c362f0d4661aa68b6f5 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Mon, 6 Nov 2023 17:11:13 +0100 Subject: [PATCH 6/6] chore(deps): update to `electron@27.0.3`. - Related change: https://github.com/arduino/arduino-ide/commit/153e34f11b9c16801eecba9d9f6f931c12b231b8 - Reported at: https://github.com/arduino/arduino-ide/pull/2267#issuecomment-1795180432 - External: https://forum.arduino.cc/t/ide-2-2-1-main-window-randomly-goes-blank/1166219 Signed-off-by: Akos Kitta --- electron-app/package.json | 4 ++-- yarn.lock | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/electron-app/package.json b/electron-app/package.json index bc8ef0545..2158fd3e3 100644 --- a/electron-app/package.json +++ b/electron-app/package.json @@ -28,8 +28,8 @@ "compression-webpack-plugin": "^9.0.0", "copy-webpack-plugin": "^8.1.1", "dateformat": "^5.0.3", - "electron": "^26.2.4", - "electron-builder": "^24.6.3", + "electron": "^27.0.3", + "electron-builder": "^24.6.4", "electron-notarize": "^1.1.1", "execa": "^7.1.1", "file-type": "^18.5.0", diff --git a/yarn.lock b/yarn.lock index 1c38ab984..2867d09d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5873,7 +5873,7 @@ ejs@^3.1.7, ejs@^3.1.8: dependencies: jake "^10.8.5" -electron-builder@^24.6.3: +electron-builder@^24.6.4: version "24.6.4" resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-24.6.4.tgz#c51271e49b9a02c9a3ec444f866b6008c4d98a1d" integrity sha512-uNWQoU7pE7qOaIQ6CJHpBi44RJFVG8OHRBIadUxrsDJVwLLo8Nma3K/EEtx5/UyWAQYdcK4nVPYKoRqBb20hbA== @@ -5958,10 +5958,10 @@ electron-updater@^4.6.5: lodash.isequal "^4.5.0" semver "^7.3.5" -electron@^26.2.4: - version "26.3.0" - resolved "https://registry.yarnpkg.com/electron/-/electron-26.3.0.tgz#3267773d170310384db76819cf6375bd98b3cc76" - integrity sha512-7ZpvSHu+jmqialSvywTZnOQZZGLqlyj+yV5HGDrEzFnMiFaXBRpbByHgoUhaExJ/8t/0xKQjKlMRAY65w+zNZQ== +electron@^27.0.3: + version "27.0.3" + resolved "https://registry.yarnpkg.com/electron/-/electron-27.0.3.tgz#dc843d95700b33d88e71b458082b66f37ca901c5" + integrity sha512-VaB9cI1se+mUtz366NP+zxFVnkHLbCBNO4wwouw3FuGyX/m7/Bv1I89JhWOBv78tC+n11ZYMrVD23Jf6EZgVcg== dependencies: "@electron/get" "^2.0.0" "@types/node" "^18.11.18"