mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-12 03:39:27 +00:00
Compare commits
34 Commits
arduino/vs
...
fix-nested
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fab2f93530 | ||
|
|
fb3c0cab7f | ||
|
|
67e863d9ea | ||
|
|
478c36c5bd | ||
|
|
aa9b10d68e | ||
|
|
4217c0001d | ||
|
|
a088ba99f5 | ||
|
|
2a325a5b74 | ||
|
|
347e3d8118 | ||
|
|
8e09971078 | ||
|
|
48e7bf6b5d | ||
|
|
95c4399c07 | ||
|
|
4a807ab538 | ||
|
|
1a98485b02 | ||
|
|
8fe6a81230 | ||
|
|
547a630598 | ||
|
|
ff8c646cfa | ||
|
|
316e0fd8be | ||
|
|
ca779e5cf2 | ||
|
|
74c580175b | ||
|
|
71bd189eb1 | ||
|
|
0822ed28da | ||
|
|
1b9c7e93e0 | ||
|
|
d419a6c6f0 | ||
|
|
dda7770105 | ||
|
|
763fde036c | ||
|
|
0e7b0c9486 | ||
|
|
b8dd39c729 | ||
|
|
d6de53780d | ||
|
|
2f2b19f613 | ||
|
|
0ca1a31747 | ||
|
|
d01f95647e | ||
|
|
074f654457 | ||
|
|
3eef857b48 |
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
@@ -45,7 +45,7 @@ on:
|
||||
|
||||
env:
|
||||
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
|
||||
GO_VERSION: '1.19'
|
||||
GO_VERSION: '1.21'
|
||||
# See: https://github.com/actions/setup-node/#readme
|
||||
NODE_VERSION: '18.17'
|
||||
JOB_TRANSFER_ARTIFACT: build-artifacts
|
||||
@@ -320,6 +320,15 @@ jobs:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Install Taskfile
|
||||
if: fromJSON(matrix.config.container) == null
|
||||
uses: arduino/setup-task@v2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: 3.x
|
||||
|
||||
- name: Install Taskfile
|
||||
# actions/setup-task@v2 has dependency on a higher version of glibc than available in the Linux container.
|
||||
if: fromJSON(matrix.config.container) != null
|
||||
uses: arduino/setup-task@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -438,7 +447,7 @@ jobs:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
uses: arduino/setup-task@v2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: 3.x
|
||||
|
||||
4
.github/workflows/check-i18n-task.yml
vendored
4
.github/workflows/check-i18n-task.yml
vendored
@@ -2,7 +2,7 @@ name: Check Internationalization
|
||||
|
||||
env:
|
||||
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
|
||||
GO_VERSION: '1.19'
|
||||
GO_VERSION: '1.21'
|
||||
|
||||
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
|
||||
on:
|
||||
@@ -71,7 +71,7 @@ jobs:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Install Taskfile
|
||||
uses: arduino/setup-task@v1
|
||||
uses: arduino/setup-task@v2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: 3.x
|
||||
|
||||
4
.github/workflows/i18n-nightly-push.yml
vendored
4
.github/workflows/i18n-nightly-push.yml
vendored
@@ -2,7 +2,7 @@ name: i18n-nightly-push
|
||||
|
||||
env:
|
||||
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
|
||||
GO_VERSION: '1.19'
|
||||
GO_VERSION: '1.21'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
uses: arduino/setup-task@v2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: 3.x
|
||||
|
||||
4
.github/workflows/i18n-weekly-pull.yml
vendored
4
.github/workflows/i18n-weekly-pull.yml
vendored
@@ -2,7 +2,7 @@ name: i18n-weekly-pull
|
||||
|
||||
env:
|
||||
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
|
||||
GO_VERSION: '1.19'
|
||||
GO_VERSION: '1.21'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
uses: arduino/setup-task@v2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: 3.x
|
||||
|
||||
4
.github/workflows/themes-weekly-pull.yml
vendored
4
.github/workflows/themes-weekly-pull.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
|
||||
env:
|
||||
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
|
||||
GO_VERSION: '1.19'
|
||||
GO_VERSION: '1.21'
|
||||
NODE_VERSION: '18.17'
|
||||
|
||||
jobs:
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
uses: arduino/setup-task@v2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: 3.x
|
||||
|
||||
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -7,6 +7,6 @@
|
||||
},
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
"source.fixAll.eslint": "explicit"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "arduino-ide-extension",
|
||||
"version": "2.2.2",
|
||||
"version": "2.3.3",
|
||||
"description": "An extension for Theia building the Arduino IDE",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"scripts": {
|
||||
@@ -63,7 +63,6 @@
|
||||
"auth0-js": "^9.23.2",
|
||||
"btoa": "^1.2.1",
|
||||
"classnames": "^2.3.1",
|
||||
"cpy": "^10.0.0",
|
||||
"cross-fetch": "^3.1.5",
|
||||
"dateformat": "^3.0.3",
|
||||
"deepmerge": "^4.2.2",
|
||||
@@ -73,6 +72,7 @@
|
||||
"fast-json-stable-stringify": "^2.1.0",
|
||||
"fast-safe-stringify": "^2.1.1",
|
||||
"filename-reserved-regex": "^2.0.0",
|
||||
"fqbn": "^1.0.5",
|
||||
"glob": "^7.1.6",
|
||||
"google-protobuf": "^3.20.1",
|
||||
"hash.js": "^1.1.7",
|
||||
@@ -170,13 +170,17 @@
|
||||
],
|
||||
"arduino": {
|
||||
"arduino-cli": {
|
||||
"version": "0.35.0-rc.7"
|
||||
"version": "0.36.0-rc.1"
|
||||
},
|
||||
"arduino-fwuploader": {
|
||||
"version": "2.4.1"
|
||||
},
|
||||
"arduino-language-server": {
|
||||
"version": "0.7.5"
|
||||
"version": {
|
||||
"owner": "arduino",
|
||||
"repo": "arduino-language-server",
|
||||
"commitish": "91c2ba8"
|
||||
}
|
||||
},
|
||||
"clangd": {
|
||||
"version": "14.0.0"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-check
|
||||
|
||||
// The version to use.
|
||||
const version = '1.10.0';
|
||||
const version = '1.10.1';
|
||||
|
||||
(async () => {
|
||||
const os = require('node:os');
|
||||
|
||||
@@ -50,7 +50,14 @@
|
||||
const suffix = (() => {
|
||||
switch (platform) {
|
||||
case 'darwin':
|
||||
return 'macOS_64bit.tar.gz';
|
||||
switch (arch) {
|
||||
case 'arm64':
|
||||
return 'macOS_ARM64.tar.gz';
|
||||
case 'x64':
|
||||
return 'macOS_64bit.tar.gz';
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
case 'win32':
|
||||
return 'Windows_64bit.zip';
|
||||
case 'linux': {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
(async () => {
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
const { mkdirSync, promises: fs } = require('node:fs');
|
||||
const { mkdirSync, promises: fs, rmSync } = require('node:fs');
|
||||
const { exec } = require('./utils');
|
||||
const glob = require('glob');
|
||||
const { SemVer, gte, valid: validSemVer } = require('semver');
|
||||
@@ -140,6 +140,10 @@
|
||||
|
||||
const rpc = path.join(repository, 'rpc');
|
||||
const out = path.join(__dirname, '..', 'src', 'node', 'cli-protocol');
|
||||
// Must wipe the gen output folder. Otherwise, dangling service implementation remain in IDE2 code,
|
||||
// although it has been removed from the proto file.
|
||||
// For example, https://github.com/arduino/arduino-cli/commit/50a8bf5c3e61d5b661ccfcd6a055e82eeb510859.
|
||||
rmSync(out, { recursive: true, maxRetries: 5, force: true });
|
||||
mkdirSync(out, { recursive: true });
|
||||
|
||||
const protos = await new Promise((resolve) =>
|
||||
|
||||
@@ -180,7 +180,7 @@ import { TabBarRenderer } from './theia/core/tab-bars';
|
||||
import { EditorCommandContribution } from './theia/editor/editor-command';
|
||||
import { NavigatorTabBarDecorator as TheiaNavigatorTabBarDecorator } from '@theia/navigator/lib/browser/navigator-tab-bar-decorator';
|
||||
import { NavigatorTabBarDecorator } from './theia/navigator/navigator-tab-bar-decorator';
|
||||
import { Debug } from './contributions/debug';
|
||||
import { Debug, DebugDisabledStatusMessageSource } from './contributions/debug';
|
||||
import { Sketchbook } from './contributions/sketchbook';
|
||||
import { DebugFrontendApplicationContribution } from './theia/debug/debug-frontend-application-contribution';
|
||||
import { DebugFrontendApplicationContribution as TheiaDebugFrontendApplicationContribution } from '@theia/debug/lib/browser/debug-frontend-application-contribution';
|
||||
@@ -365,13 +365,13 @@ import { AutoSelectProgrammer } from './contributions/auto-select-programmer';
|
||||
import { HostedPluginSupport } from './hosted/hosted-plugin-support';
|
||||
import { DebugSessionManager as TheiaDebugSessionManager } from '@theia/debug/lib/browser/debug-session-manager';
|
||||
import { DebugSessionManager } from './theia/debug/debug-session-manager';
|
||||
import { DebugWidget } from '@theia/debug/lib/browser/view/debug-widget';
|
||||
import { DebugWidget as TheiaDebugWidget } from '@theia/debug/lib/browser/view/debug-widget';
|
||||
import { DebugWidget } from './theia/debug/debug-widget';
|
||||
import { DebugViewModel } from '@theia/debug/lib/browser/view/debug-view-model';
|
||||
import { DebugSessionWidget } from '@theia/debug/lib/browser/view/debug-session-widget';
|
||||
import { DebugConfigurationWidget } from './theia/debug/debug-configuration-widget';
|
||||
import { DebugConfigurationWidget as TheiaDebugConfigurationWidget } from '@theia/debug/lib/browser/view/debug-configuration-widget';
|
||||
import { DebugToolBar } from '@theia/debug/lib/browser/view/debug-toolbar-widget';
|
||||
import { InoHighlight } from './contributions/ino-highlight';
|
||||
|
||||
// Hack to fix copy/cut/paste issue after electron version update in Theia.
|
||||
// https://github.com/eclipse-theia/theia/issues/12487
|
||||
@@ -768,11 +768,12 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
||||
Contribution.configure(bind, UpdateArduinoState);
|
||||
Contribution.configure(bind, BoardsDataMenuUpdater);
|
||||
Contribution.configure(bind, AutoSelectProgrammer);
|
||||
Contribution.configure(bind, InoHighlight);
|
||||
|
||||
bindContributionProvider(bind, StartupTaskProvider);
|
||||
bind(StartupTaskProvider).toService(BoardsServiceProvider); // to reuse the boards config in another window
|
||||
|
||||
bind(DebugDisabledStatusMessageSource).toService(Debug);
|
||||
|
||||
// Disabled the quick-pick customization from Theia when multiple formatters are available.
|
||||
// Use the default VS Code behavior, and pick the first one. In the IDE2, clang-format has `exclusive` selectors.
|
||||
bind(MonacoFormattingConflictsContribution).toSelf().inSingletonScope();
|
||||
@@ -876,7 +877,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
||||
// Customized debug widget with its customized config <select> to update it programmatically.
|
||||
bind(WidgetFactory)
|
||||
.toDynamicValue(({ container }) => ({
|
||||
id: DebugWidget.ID,
|
||||
id: TheiaDebugWidget.ID,
|
||||
createWidget: () => {
|
||||
const child = new Container({ defaultScope: 'Singleton' });
|
||||
child.parent = container;
|
||||
|
||||
@@ -54,6 +54,10 @@ export function isMonitorWidgetDockPanel(
|
||||
return arg === 'bottom' || arg === 'right';
|
||||
}
|
||||
|
||||
export const defaultAsyncWorkers = 0 as const;
|
||||
export const minAsyncWorkers = defaultAsyncWorkers;
|
||||
export const maxAsyncWorkers = 8 as const;
|
||||
|
||||
type StrictPreferenceSchemaProperties<T extends object> = {
|
||||
[p in keyof T]: PreferenceSchemaProperty;
|
||||
};
|
||||
@@ -79,6 +83,16 @@ const properties: ArduinoPreferenceSchemaProperties = {
|
||||
),
|
||||
default: false,
|
||||
},
|
||||
'arduino.language.asyncWorkers': {
|
||||
type: 'number',
|
||||
description: nls.localize(
|
||||
'arduino/preferences/language.asyncWorkers',
|
||||
'Number of async workers used by the Arduino Language Server (clangd). Background index also uses this many workers. The minimum value is 0, and the maximum is 8. When it is 0, the language server uses all available cores. The default value is 0.'
|
||||
),
|
||||
minimum: minAsyncWorkers,
|
||||
maximum: maxAsyncWorkers,
|
||||
default: defaultAsyncWorkers,
|
||||
},
|
||||
'arduino.compile.verbose': {
|
||||
type: 'boolean',
|
||||
description: nls.localize(
|
||||
@@ -298,6 +312,7 @@ export const ArduinoConfigSchema: PreferenceSchema = {
|
||||
export interface ArduinoConfiguration {
|
||||
'arduino.language.log': boolean;
|
||||
'arduino.language.realTimeDiagnostics': boolean;
|
||||
'arduino.language.asyncWorkers': number;
|
||||
'arduino.compile.verbose': boolean;
|
||||
'arduino.compile.experimental': boolean;
|
||||
'arduino.compile.revealRange': ErrorRevealStrategy;
|
||||
|
||||
@@ -12,6 +12,7 @@ import { ILogger } from '@theia/core/lib/common/logger';
|
||||
import { deepClone, deepFreeze } 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 { FQBN } from 'fqbn';
|
||||
import {
|
||||
BoardDetails,
|
||||
BoardsService,
|
||||
@@ -20,6 +21,7 @@ import {
|
||||
Programmer,
|
||||
isBoardIdentifierChangeEvent,
|
||||
isProgrammer,
|
||||
sanitizeFqbn,
|
||||
} from '../../common/protocol';
|
||||
import { notEmpty } from '../../common/utils';
|
||||
import type {
|
||||
@@ -29,6 +31,14 @@ import type {
|
||||
import { NotificationCenter } from '../notification-center';
|
||||
import { BoardsServiceProvider } from './boards-service-provider';
|
||||
|
||||
export interface SelectConfigOptionParams {
|
||||
readonly fqbn: string;
|
||||
readonly optionsToUpdate: readonly Readonly<{
|
||||
option: string;
|
||||
selectedValue: string;
|
||||
}>[];
|
||||
}
|
||||
|
||||
@injectable()
|
||||
export class BoardsDataStore
|
||||
implements
|
||||
@@ -64,7 +74,12 @@ export class BoardsDataStore
|
||||
this.toDispose.pushAll([
|
||||
this.boardsServiceProvider.onBoardsConfigDidChange((event) => {
|
||||
if (isBoardIdentifierChangeEvent(event)) {
|
||||
this.updateSelectedBoardData(event.selectedBoard?.fqbn);
|
||||
this.updateSelectedBoardData(
|
||||
event.selectedBoard?.fqbn,
|
||||
// If the change event comes from toolbar and the FQBN contains custom board options, change the currently selected options
|
||||
// https://github.com/arduino/arduino-ide/issues/1588
|
||||
event.reason === 'toolbar'
|
||||
);
|
||||
}
|
||||
}),
|
||||
this.notificationCenter.onPlatformDidInstall(async ({ item }) => {
|
||||
@@ -116,7 +131,7 @@ export class BoardsDataStore
|
||||
if (!fqbn) {
|
||||
return undefined;
|
||||
} else {
|
||||
const data = await this.getData(fqbn);
|
||||
const data = await this.getData(sanitizeFqbn(fqbn));
|
||||
if (data === BoardsDataStore.Data.EMPTY) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -125,9 +140,22 @@ export class BoardsDataStore
|
||||
}
|
||||
|
||||
private async updateSelectedBoardData(
|
||||
fqbn: string | undefined
|
||||
fqbn: string | undefined,
|
||||
updateConfigOptions = false
|
||||
): Promise<void> {
|
||||
this._selectedBoardData = await this.getSelectedBoardData(fqbn);
|
||||
if (fqbn && updateConfigOptions) {
|
||||
const { options } = new FQBN(fqbn);
|
||||
if (options) {
|
||||
const optionsToUpdate = Object.entries(options).map(([key, value]) => ({
|
||||
option: key,
|
||||
selectedValue: value,
|
||||
}));
|
||||
const params = { fqbn, optionsToUpdate };
|
||||
await this.selectConfigOption(params);
|
||||
this._selectedBoardData = await this.getSelectedBoardData(fqbn); // reload the updated data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onStop(): void {
|
||||
@@ -168,7 +196,7 @@ export class BoardsDataStore
|
||||
return undefined;
|
||||
}
|
||||
const { configOptions } = await this.getData(fqbn);
|
||||
return ConfigOption.decorate(fqbn, configOptions);
|
||||
return new FQBN(fqbn).withConfigOptions(...configOptions).toString();
|
||||
}
|
||||
|
||||
async getData(fqbn: string | undefined): Promise<BoardsDataStore.Data> {
|
||||
@@ -201,48 +229,63 @@ export class BoardsDataStore
|
||||
fqbn: string;
|
||||
selectedProgrammer: Programmer;
|
||||
}): Promise<boolean> {
|
||||
const storedData = deepClone(await this.getData(fqbn));
|
||||
const sanitizedFQBN = sanitizeFqbn(fqbn);
|
||||
const storedData = deepClone(await this.getData(sanitizedFQBN));
|
||||
const { programmers } = storedData;
|
||||
if (!programmers.find((p) => Programmer.equals(selectedProgrammer, p))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const data = { ...storedData, selectedProgrammer };
|
||||
await this.setData({ fqbn, data });
|
||||
this.fireChanged({ fqbn, data });
|
||||
const change: BoardsDataStoreChange = {
|
||||
fqbn: sanitizedFQBN,
|
||||
data: { ...storedData, selectedProgrammer },
|
||||
};
|
||||
await this.setData(change);
|
||||
this.fireChanged(change);
|
||||
return true;
|
||||
}
|
||||
|
||||
async selectConfigOption({
|
||||
fqbn,
|
||||
option,
|
||||
selectedValue,
|
||||
}: {
|
||||
fqbn: string;
|
||||
option: string;
|
||||
selectedValue: string;
|
||||
}): Promise<boolean> {
|
||||
const data = deepClone(await this.getData(fqbn));
|
||||
const { configOptions } = data;
|
||||
const configOption = configOptions.find((c) => c.option === option);
|
||||
if (!configOption) {
|
||||
async selectConfigOption(params: SelectConfigOptionParams): Promise<boolean> {
|
||||
const { fqbn, optionsToUpdate } = params;
|
||||
if (!optionsToUpdate.length) {
|
||||
return false;
|
||||
}
|
||||
let updated = false;
|
||||
for (const value of configOption.values) {
|
||||
const mutable: Mutable<ConfigValue> = value;
|
||||
if (mutable.value === selectedValue) {
|
||||
mutable.selected = true;
|
||||
updated = true;
|
||||
} else {
|
||||
mutable.selected = false;
|
||||
|
||||
const sanitizedFQBN = sanitizeFqbn(fqbn);
|
||||
const mutableData = deepClone(await this.getData(sanitizedFQBN));
|
||||
let didChange = false;
|
||||
|
||||
for (const { option, selectedValue } of optionsToUpdate) {
|
||||
const { configOptions } = mutableData;
|
||||
const configOption = configOptions.find((c) => c.option === option);
|
||||
if (configOption) {
|
||||
const configOptionValueIndex = configOption.values.findIndex(
|
||||
(configOptionValue) => configOptionValue.value === selectedValue
|
||||
);
|
||||
if (configOptionValueIndex >= 0) {
|
||||
// unselect all
|
||||
configOption.values
|
||||
.map((value) => value as Mutable<ConfigValue>)
|
||||
.forEach((value) => (value.selected = false));
|
||||
const mutableConfigValue: Mutable<ConfigValue> =
|
||||
configOption.values[configOptionValueIndex];
|
||||
// make the new value `selected`
|
||||
mutableConfigValue.selected = true;
|
||||
didChange = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!updated) {
|
||||
|
||||
if (!didChange) {
|
||||
return false;
|
||||
}
|
||||
await this.setData({ fqbn, data });
|
||||
this.fireChanged({ fqbn, data });
|
||||
|
||||
const change: BoardsDataStoreChange = {
|
||||
fqbn: sanitizedFQBN,
|
||||
data: mutableData,
|
||||
};
|
||||
await this.setData(change);
|
||||
this.fireChanged(change);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import { Emitter } from '@theia/core/lib/common/event';
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
import { MessageService } from '@theia/core/lib/common/message-service';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import { deepClone } from '@theia/core/lib/common/objects';
|
||||
import { Deferred } from '@theia/core/lib/common/promise-util';
|
||||
import type { Mutable } from '@theia/core/lib/common/types';
|
||||
import { inject, injectable, optional } from '@theia/core/shared/inversify';
|
||||
@@ -21,31 +22,32 @@ import {
|
||||
} from '@theia/output/lib/browser/output-channel';
|
||||
import {
|
||||
BoardIdentifier,
|
||||
boardIdentifierEquals,
|
||||
BoardUserField,
|
||||
BoardWithPackage,
|
||||
BoardsConfig,
|
||||
BoardsConfigChangeEvent,
|
||||
BoardsPackage,
|
||||
BoardsService,
|
||||
BoardUserField,
|
||||
BoardWithPackage,
|
||||
DetectedPorts,
|
||||
Port,
|
||||
PortIdentifier,
|
||||
boardIdentifierEquals,
|
||||
emptyBoardsConfig,
|
||||
isBoardIdentifier,
|
||||
isBoardIdentifierChangeEvent,
|
||||
isPortIdentifier,
|
||||
isPortIdentifierChangeEvent,
|
||||
Port,
|
||||
PortIdentifier,
|
||||
portIdentifierEquals,
|
||||
sanitizeFqbn,
|
||||
serializePlatformIdentifier,
|
||||
} from '../../common/protocol';
|
||||
import {
|
||||
BoardList,
|
||||
BoardListHistory,
|
||||
createBoardList,
|
||||
EditBoardsConfigActionParams,
|
||||
isBoardListHistory,
|
||||
SelectBoardsConfigActionParams,
|
||||
createBoardList,
|
||||
isBoardListHistory,
|
||||
} from '../../common/protocol/board-list';
|
||||
import type { Defined } from '../../common/types';
|
||||
import type {
|
||||
@@ -104,6 +106,21 @@ type BoardListHistoryUpdateResult =
|
||||
type BoardToSelect = BoardIdentifier | undefined | 'ignore-board';
|
||||
type PortToSelect = PortIdentifier | undefined | 'ignore-port';
|
||||
|
||||
function sanitizeBoardToSelectFQBN(board: BoardToSelect): BoardToSelect {
|
||||
if (isBoardIdentifier(board)) {
|
||||
return sanitizeBoardIdentifierFQBN(board);
|
||||
}
|
||||
return board;
|
||||
}
|
||||
function sanitizeBoardIdentifierFQBN(board: BoardIdentifier): BoardIdentifier {
|
||||
if (board.fqbn) {
|
||||
const copy: Mutable<BoardIdentifier> = deepClone(board);
|
||||
copy.fqbn = sanitizeFqbn(board.fqbn);
|
||||
return copy;
|
||||
}
|
||||
return board;
|
||||
}
|
||||
|
||||
interface UpdateBoardListHistoryParams {
|
||||
readonly portToSelect: PortToSelect;
|
||||
readonly boardToSelect: BoardToSelect;
|
||||
@@ -136,6 +153,9 @@ export interface BoardListUIActions {
|
||||
}
|
||||
export type BoardListUI = BoardList & BoardListUIActions;
|
||||
|
||||
export type BoardsConfigChangeEventUI = BoardsConfigChangeEvent &
|
||||
Readonly<{ reason?: UpdateBoardsConfigReason }>;
|
||||
|
||||
@injectable()
|
||||
export class BoardListDumper implements Disposable {
|
||||
@inject(OutputChannelManager)
|
||||
@@ -190,7 +210,7 @@ export class BoardsServiceProvider
|
||||
private _ready = new Deferred<void>();
|
||||
|
||||
private readonly boardsConfigDidChangeEmitter =
|
||||
new Emitter<BoardsConfigChangeEvent>();
|
||||
new Emitter<BoardsConfigChangeEventUI>();
|
||||
readonly onBoardsConfigDidChange = this.boardsConfigDidChangeEmitter.event;
|
||||
|
||||
private readonly boardListDidChangeEmitter = new Emitter<BoardListUI>();
|
||||
@@ -353,7 +373,8 @@ export class BoardsServiceProvider
|
||||
portToSelect !== 'ignore-port' &&
|
||||
!portIdentifierEquals(portToSelect, previousSelectedPort);
|
||||
const boardDidChangeEvent = boardDidChange
|
||||
? { selectedBoard: boardToSelect, previousSelectedBoard }
|
||||
? // The change event must always contain any custom board options. Hence the board to select is not sanitized.
|
||||
{ selectedBoard: boardToSelect, previousSelectedBoard }
|
||||
: undefined;
|
||||
const portDidChangeEvent = portDidChange
|
||||
? { selectedPort: portToSelect, previousSelectedPort }
|
||||
@@ -374,16 +395,31 @@ export class BoardsServiceProvider
|
||||
return false;
|
||||
}
|
||||
|
||||
this.maybeUpdateBoardListHistory({ portToSelect, boardToSelect });
|
||||
this.maybeUpdateBoardsData({ boardToSelect, reason });
|
||||
// unlike for the board change event, every persistent state must not contain custom board config options in the FQBN
|
||||
const sanitizedBoardToSelect = sanitizeBoardToSelectFQBN(boardToSelect);
|
||||
|
||||
this.maybeUpdateBoardListHistory({
|
||||
portToSelect,
|
||||
boardToSelect: sanitizedBoardToSelect,
|
||||
});
|
||||
this.maybeUpdateBoardsData({
|
||||
boardToSelect: sanitizedBoardToSelect,
|
||||
reason,
|
||||
});
|
||||
|
||||
if (isBoardIdentifierChangeEvent(event)) {
|
||||
this._boardsConfig.selectedBoard = event.selectedBoard;
|
||||
this._boardsConfig.selectedBoard = event.selectedBoard
|
||||
? sanitizeBoardIdentifierFQBN(event.selectedBoard)
|
||||
: event.selectedBoard;
|
||||
}
|
||||
if (isPortIdentifierChangeEvent(event)) {
|
||||
this._boardsConfig.selectedPort = event.selectedPort;
|
||||
}
|
||||
|
||||
if (reason) {
|
||||
event = Object.assign(event, { reason });
|
||||
}
|
||||
|
||||
this.boardsConfigDidChangeEmitter.fire(event);
|
||||
this.refreshBoardList();
|
||||
this.saveState();
|
||||
|
||||
@@ -87,8 +87,7 @@ export class BoardsDataMenuUpdater extends Contribution {
|
||||
execute: () =>
|
||||
this.boardsDataStore.selectConfigOption({
|
||||
fqbn,
|
||||
option,
|
||||
selectedValue: value.value,
|
||||
optionsToUpdate: [{ option, selectedValue: value.value }],
|
||||
}),
|
||||
isToggled: () => value.selected,
|
||||
};
|
||||
|
||||
@@ -37,11 +37,15 @@ export class BurnBootloader extends CoreServiceContribution {
|
||||
'arduino/bootloader/burningBootloader',
|
||||
'Burning bootloader...'
|
||||
),
|
||||
task: (progressId, coreService) =>
|
||||
coreService.burnBootloader({
|
||||
...options,
|
||||
progressId,
|
||||
}),
|
||||
task: (progressId, coreService, token) =>
|
||||
coreService.burnBootloader(
|
||||
{
|
||||
...options,
|
||||
progressId,
|
||||
},
|
||||
token
|
||||
),
|
||||
cancelable: true,
|
||||
});
|
||||
this.messageService.info(
|
||||
nls.localize(
|
||||
|
||||
@@ -1,83 +1,89 @@
|
||||
import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
|
||||
import {
|
||||
FrontendApplication,
|
||||
FrontendApplicationContribution,
|
||||
} from '@theia/core/lib/browser/frontend-application';
|
||||
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
||||
import {
|
||||
KeybindingContribution,
|
||||
KeybindingRegistry,
|
||||
} from '@theia/core/lib/browser/keybinding';
|
||||
import { LabelProvider } from '@theia/core/lib/browser/label-provider';
|
||||
import { OpenerService, open } from '@theia/core/lib/browser/opener-service';
|
||||
import { Saveable } from '@theia/core/lib/browser/saveable';
|
||||
import { ApplicationShell } from '@theia/core/lib/browser/shell/application-shell';
|
||||
import {
|
||||
TabBarToolbarContribution,
|
||||
TabBarToolbarRegistry,
|
||||
} from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
||||
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
||||
import {
|
||||
Command,
|
||||
CommandContribution,
|
||||
CommandRegistry,
|
||||
CommandService,
|
||||
} from '@theia/core/lib/common/command';
|
||||
import {
|
||||
Disposable,
|
||||
DisposableCollection,
|
||||
} from '@theia/core/lib/common/disposable';
|
||||
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
import {
|
||||
MenuContribution,
|
||||
MenuModelRegistry,
|
||||
} from '@theia/core/lib/common/menu';
|
||||
import { MessageService } from '@theia/core/lib/common/message-service';
|
||||
import { MessageType } from '@theia/core/lib/common/message-service-protocol';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import { MaybePromise, isObject } from '@theia/core/lib/common/types';
|
||||
import URI from '@theia/core/lib/common/uri';
|
||||
import {
|
||||
inject,
|
||||
injectable,
|
||||
interfaces,
|
||||
postConstruct,
|
||||
} from '@theia/core/shared/inversify';
|
||||
import URI from '@theia/core/lib/common/uri';
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
import {
|
||||
Disposable,
|
||||
DisposableCollection,
|
||||
} from '@theia/core/lib/common/disposable';
|
||||
import { Saveable } from '@theia/core/lib/browser/saveable';
|
||||
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
||||
import { MaybePromise } from '@theia/core/lib/common/types';
|
||||
import { LabelProvider } from '@theia/core/lib/browser/label-provider';
|
||||
import { EditorManager } from '@theia/editor/lib/browser/editor-manager';
|
||||
import { MessageService } from '@theia/core/lib/common/message-service';
|
||||
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
||||
import { open, OpenerService } from '@theia/core/lib/browser/opener-service';
|
||||
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
||||
import { NotificationManager } from '@theia/messages/lib/browser/notifications-manager';
|
||||
import { OutputChannelSeverity } from '@theia/output/lib/browser/output-channel';
|
||||
import { MainMenuManager } from '../../common/main-menu-manager';
|
||||
import { userAbort } from '../../common/nls';
|
||||
import {
|
||||
MenuModelRegistry,
|
||||
MenuContribution,
|
||||
} from '@theia/core/lib/common/menu';
|
||||
CoreError,
|
||||
CoreService,
|
||||
FileSystemExt,
|
||||
ResponseServiceClient,
|
||||
Sketch,
|
||||
SketchesService,
|
||||
} from '../../common/protocol';
|
||||
import {
|
||||
KeybindingRegistry,
|
||||
KeybindingContribution,
|
||||
} from '@theia/core/lib/browser/keybinding';
|
||||
import {
|
||||
TabBarToolbarContribution,
|
||||
TabBarToolbarRegistry,
|
||||
} from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
||||
import {
|
||||
FrontendApplicationContribution,
|
||||
FrontendApplication,
|
||||
} from '@theia/core/lib/browser/frontend-application';
|
||||
import {
|
||||
Command,
|
||||
CommandRegistry,
|
||||
CommandContribution,
|
||||
CommandService,
|
||||
} from '@theia/core/lib/common/command';
|
||||
ExecuteWithProgress,
|
||||
UserAbortApplicationError,
|
||||
} from '../../common/protocol/progressible';
|
||||
import { ArduinoPreferences } from '../arduino-preferences';
|
||||
import { BoardsDataStore } from '../boards/boards-data-store';
|
||||
import { BoardsServiceProvider } from '../boards/boards-service-provider';
|
||||
import { ConfigServiceClient } from '../config/config-service-client';
|
||||
import { DialogService } from '../dialog-service';
|
||||
import { SettingsService } from '../dialogs/settings/settings';
|
||||
import {
|
||||
CurrentSketch,
|
||||
SketchesServiceClientImpl,
|
||||
} from '../sketches-service-client-impl';
|
||||
import {
|
||||
SketchesService,
|
||||
FileSystemExt,
|
||||
Sketch,
|
||||
CoreService,
|
||||
CoreError,
|
||||
ResponseServiceClient,
|
||||
} from '../../common/protocol';
|
||||
import { ArduinoPreferences } from '../arduino-preferences';
|
||||
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
||||
import { nls } from '@theia/core';
|
||||
import { OutputChannelManager } from '../theia/output/output-channel';
|
||||
import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
|
||||
import { ExecuteWithProgress } from '../../common/protocol/progressible';
|
||||
import { BoardsServiceProvider } from '../boards/boards-service-provider';
|
||||
import { BoardsDataStore } from '../boards/boards-data-store';
|
||||
import { NotificationManager } from '@theia/messages/lib/browser/notifications-manager';
|
||||
import { MessageType } from '@theia/core/lib/common/message-service-protocol';
|
||||
import { WorkspaceService } from '../theia/workspace/workspace-service';
|
||||
import { MainMenuManager } from '../../common/main-menu-manager';
|
||||
import { ConfigServiceClient } from '../config/config-service-client';
|
||||
import { ApplicationShell } from '@theia/core/lib/browser/shell/application-shell';
|
||||
import { DialogService } from '../dialog-service';
|
||||
import { ApplicationConnectionStatusContribution } from '../theia/core/connection-status-service';
|
||||
import { OutputChannelManager } from '../theia/output/output-channel';
|
||||
import { WorkspaceService } from '../theia/workspace/workspace-service';
|
||||
|
||||
export {
|
||||
Command,
|
||||
CommandRegistry,
|
||||
MenuModelRegistry,
|
||||
KeybindingRegistry,
|
||||
MenuModelRegistry,
|
||||
Sketch,
|
||||
TabBarToolbarRegistry,
|
||||
URI,
|
||||
Sketch,
|
||||
open,
|
||||
};
|
||||
|
||||
@@ -247,6 +253,12 @@ export abstract class CoreServiceContribution extends SketchContribution {
|
||||
}
|
||||
|
||||
protected handleError(error: unknown): void {
|
||||
if (isObject(error) && UserAbortApplicationError.is(error)) {
|
||||
this.outputChannelManager
|
||||
.getChannel('Arduino')
|
||||
.appendLine(userAbort, OutputChannelSeverity.Warning);
|
||||
return;
|
||||
}
|
||||
this.tryToastErrorMessage(error);
|
||||
}
|
||||
|
||||
@@ -293,7 +305,13 @@ export abstract class CoreServiceContribution extends SketchContribution {
|
||||
protected async doWithProgress<T>(options: {
|
||||
progressText: string;
|
||||
keepOutput?: boolean;
|
||||
task: (progressId: string, coreService: CoreService) => Promise<T>;
|
||||
task: (
|
||||
progressId: string,
|
||||
coreService: CoreService,
|
||||
cancellationToken?: CancellationToken
|
||||
) => Promise<T>;
|
||||
// false by default
|
||||
cancelable?: boolean;
|
||||
}): Promise<T> {
|
||||
const toDisposeOnComplete = new DisposableCollection(
|
||||
this.maybeActivateMonitorWidget()
|
||||
@@ -306,8 +324,10 @@ export abstract class CoreServiceContribution extends SketchContribution {
|
||||
messageService: this.messageService,
|
||||
responseService: this.responseService,
|
||||
progressText,
|
||||
run: ({ progressId }) => task(progressId, this.coreService),
|
||||
run: ({ progressId, cancellationToken }) =>
|
||||
task(progressId, this.coreService, cancellationToken),
|
||||
keepOutput,
|
||||
cancelable: options.cancelable,
|
||||
});
|
||||
toDisposeOnComplete.dispose();
|
||||
return result;
|
||||
|
||||
@@ -64,8 +64,26 @@ interface StartDebugParams {
|
||||
}
|
||||
type StartDebugResult = boolean;
|
||||
|
||||
export const DebugDisabledStatusMessageSource = Symbol(
|
||||
'DebugDisabledStatusMessageSource'
|
||||
);
|
||||
export interface DebugDisabledStatusMessageSource {
|
||||
/**
|
||||
* `undefined` if debugging is enabled (for the currently selected board + programmer + config options).
|
||||
* Otherwise, it's the human readable message why it's disabled.
|
||||
*/
|
||||
get message(): string | undefined;
|
||||
/**
|
||||
* Emits an event when {@link message} changes.
|
||||
*/
|
||||
get onDidChangeMessage(): Event<string | undefined>;
|
||||
}
|
||||
|
||||
@injectable()
|
||||
export class Debug extends SketchContribution {
|
||||
export class Debug
|
||||
extends SketchContribution
|
||||
implements DebugDisabledStatusMessageSource
|
||||
{
|
||||
@inject(HostedPluginSupport)
|
||||
private readonly hostedPluginSupport: HostedPluginSupport;
|
||||
@inject(NotificationCenter)
|
||||
@@ -83,10 +101,10 @@ export class Debug extends SketchContribution {
|
||||
* If `undefined`, debugging is enabled. Otherwise, the human-readable reason why it's disabled.
|
||||
*/
|
||||
private _message?: string = noBoardSelected; // Initial pessimism.
|
||||
private didChangeMessageEmitter = new Emitter<string | undefined>();
|
||||
private onDidChangeMessage = this.didChangeMessageEmitter.event;
|
||||
private readonly didChangeMessageEmitter = new Emitter<string | undefined>();
|
||||
readonly onDidChangeMessage = this.didChangeMessageEmitter.event;
|
||||
|
||||
private get message(): string | undefined {
|
||||
get message(): string | undefined {
|
||||
return this._message;
|
||||
}
|
||||
private set message(message: string | undefined) {
|
||||
@@ -349,6 +367,8 @@ export namespace Debug {
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves with the FQBN to use for the `debug --info --programmer p --fqbn $FQBN` command. Otherwise, rejects.
|
||||
*
|
||||
* (non-API)
|
||||
*/
|
||||
export async function isDebugEnabled(
|
||||
@@ -378,12 +398,9 @@ export async function isDebugEnabled(
|
||||
`Failed to append boards config to the FQBN. Original FQBN was: ${fqbn}`
|
||||
);
|
||||
}
|
||||
if (!data.selectedProgrammer) {
|
||||
throw new Error(noProgrammerSelectedFor(board.name));
|
||||
}
|
||||
const params = {
|
||||
fqbn: fqbnWithConfig,
|
||||
programmer: data.selectedProgrammer.id,
|
||||
programmer: data.selectedProgrammer?.id,
|
||||
};
|
||||
try {
|
||||
const debugFqbn = await checkDebugEnabled(params);
|
||||
@@ -423,13 +440,3 @@ export function debuggingNotSupported(boardName: string): string {
|
||||
boardName
|
||||
);
|
||||
}
|
||||
/**
|
||||
* (non-API)
|
||||
*/
|
||||
export function noProgrammerSelectedFor(boardName: string): string {
|
||||
return nls.localize(
|
||||
'arduino/debug/noProgrammerSelectedFor',
|
||||
"No programmer selected for '{0}'",
|
||||
boardName
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { MaybePromise } from '@theia/core';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import * as monaco from '@theia/monaco-editor-core';
|
||||
import { Formatter } from '../../common/protocol/formatter';
|
||||
@@ -14,14 +15,13 @@ export class Format
|
||||
@inject(Formatter)
|
||||
private readonly formatter: Formatter;
|
||||
|
||||
override onStart(): void {
|
||||
override onStart(): MaybePromise<void> {
|
||||
monaco.languages.registerDocumentRangeFormattingEditProvider(
|
||||
InoSelector,
|
||||
this
|
||||
);
|
||||
monaco.languages.registerDocumentFormattingEditProvider(InoSelector, this);
|
||||
}
|
||||
|
||||
async provideDocumentRangeFormattingEdits(
|
||||
model: monaco.editor.ITextModel,
|
||||
range: monaco.Range,
|
||||
|
||||
@@ -1,558 +0,0 @@
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import * as monaco from '@theia/monaco-editor-core';
|
||||
import { DEFAULT_WORD_REGEXP } from '@theia/monaco-editor-core/esm/vs/editor/common/core/wordHelper';
|
||||
import { StandardTokenType } from '@theia/monaco-editor-core/esm/vs/editor/common/encodedTokenAttributes';
|
||||
import { TokenizationTextModelPart } from '@theia/monaco-editor-core/esm/vs/editor/common/model/tokenizationTextModelPart';
|
||||
import { ITokenizationTextModelPart } from '@theia/monaco-editor-core/esm/vs/editor/common/tokenizationTextModelPart';
|
||||
import { SemanticTokensBuilder } from '@theia/plugin-ext/lib/plugin/types-impl';
|
||||
import { HostedPluginSupport } from '../hosted/hosted-plugin-support';
|
||||
import { InoSelector } from '../selectors';
|
||||
import { SketchContribution } from './contribution';
|
||||
|
||||
interface TokenizationOwner {
|
||||
readonly tokenization: ITokenizationTextModelPart;
|
||||
}
|
||||
|
||||
function hasTokenization(arg: unknown): arg is TokenizationOwner {
|
||||
return (
|
||||
typeof arg === 'object' &&
|
||||
arg !== null &&
|
||||
(<TokenizationOwner>arg).tokenization !== undefined &&
|
||||
(<TokenizationOwner>arg).tokenization instanceof TokenizationTextModelPart
|
||||
);
|
||||
}
|
||||
|
||||
@injectable()
|
||||
export class InoHighlight
|
||||
extends SketchContribution
|
||||
implements monaco.languages.DocumentSemanticTokensProvider
|
||||
{
|
||||
@inject(HostedPluginSupport)
|
||||
private readonly hostedPluginSupport: HostedPluginSupport;
|
||||
|
||||
private readonly _legend: monaco.languages.SemanticTokensLegend = {
|
||||
tokenModifiers: [],
|
||||
tokenTypes: vsCodeTokenTypeLiterals.slice(),
|
||||
};
|
||||
|
||||
override onStart(): void {
|
||||
monaco.languages.registerDocumentSemanticTokensProvider(InoSelector, this);
|
||||
}
|
||||
|
||||
getLegend(): monaco.languages.SemanticTokensLegend {
|
||||
return this._legend;
|
||||
}
|
||||
|
||||
async provideDocumentSemanticTokens(
|
||||
model: monaco.editor.ITextModel,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-vars
|
||||
lastResultId: string | null,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-vars
|
||||
token: monaco.CancellationToken
|
||||
): Promise<monaco.languages.SemanticTokens> {
|
||||
await this.hostedPluginSupport.didStart;
|
||||
const start = performance.now();
|
||||
const builder = new SemanticTokensBuilder();
|
||||
if (!hasTokenization(model)) {
|
||||
return builder.build();
|
||||
}
|
||||
const parsedTokens = getHighlightedTokens(model);
|
||||
for (const parsedToken of parsedTokens) {
|
||||
builder.push(
|
||||
parsedToken.line,
|
||||
parsedToken.startCharacter,
|
||||
parsedToken.length,
|
||||
vsCodeTokenIndex[parsedToken.tokenType]
|
||||
);
|
||||
}
|
||||
const tokens = builder.build();
|
||||
console.log(
|
||||
'provideDocumentSemanticTokens',
|
||||
performance.now() - start + 'ms',
|
||||
'lastResultId',
|
||||
lastResultId
|
||||
);
|
||||
return tokens;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
releaseDocumentSemanticTokens(lastResultId: string | undefined): void {
|
||||
console.log('releaseDocumentSemanticTokens', 'lastResultId', lastResultId);
|
||||
// NOOP
|
||||
}
|
||||
}
|
||||
|
||||
interface IParsedToken {
|
||||
line: number;
|
||||
startCharacter: number;
|
||||
length: number;
|
||||
tokenType: VSCodeTokenType;
|
||||
tokenModifiers: string[];
|
||||
}
|
||||
|
||||
const MAX_TOKENIZATION_LINE_LEN = 500; // If line is too long tokenization is skipped
|
||||
function getHighlightedTokens(
|
||||
model: (monaco.editor.ITextModel & TokenizationOwner) | null
|
||||
): IParsedToken[] {
|
||||
const result: IParsedToken[] = [];
|
||||
if (!model) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// For every word in every line, map its ranges for fast lookup
|
||||
for (
|
||||
let lineNumber = 1, len = model.getLineCount();
|
||||
lineNumber <= len;
|
||||
++lineNumber
|
||||
) {
|
||||
const lineLength = model.getLineLength(lineNumber);
|
||||
// If line is too long then skip the line
|
||||
if (lineLength > MAX_TOKENIZATION_LINE_LEN) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const lineContent = model.getLineContent(lineNumber);
|
||||
model.tokenization.resetTokenization();
|
||||
model.tokenization.forceTokenization(lineNumber);
|
||||
const lineTokens = model.tokenization.getLineTokens(lineNumber);
|
||||
for (
|
||||
let tokenIndex = 0, tokenCount = lineTokens.getCount();
|
||||
tokenIndex < tokenCount;
|
||||
tokenIndex++
|
||||
) {
|
||||
const tokenType = lineTokens.getStandardTokenType(tokenIndex);
|
||||
|
||||
// Token is a word and not a comment
|
||||
if (tokenType === StandardTokenType.Other) {
|
||||
// reset the stateful regex
|
||||
DEFAULT_WORD_REGEXP.lastIndex = 0; // We assume tokens will usually map 1:1 to words if they match
|
||||
|
||||
const tokenStartOffset = lineTokens.getStartOffset(tokenIndex);
|
||||
const tokenEndOffset = lineTokens.getEndOffset(tokenIndex);
|
||||
const tokenStr = lineContent.substring(
|
||||
tokenStartOffset,
|
||||
tokenEndOffset
|
||||
);
|
||||
const wordMatch = DEFAULT_WORD_REGEXP.exec(tokenStr);
|
||||
|
||||
if (wordMatch) {
|
||||
const word = wordMatch[0];
|
||||
const tokenType = getTokenType(word);
|
||||
if (tokenType) {
|
||||
result.push({
|
||||
line: lineNumber - 1, // map monaco 1 index to protocol 0 index
|
||||
startCharacter: tokenStartOffset + wordMatch.index,
|
||||
length: word.length,
|
||||
tokenModifiers: [],
|
||||
tokenType,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
const arduinoTokenTypeLiterals = [
|
||||
'type',
|
||||
'built_in',
|
||||
'_hints',
|
||||
'literal',
|
||||
] as const;
|
||||
type ArduinoTokenType = (typeof arduinoTokenTypeLiterals)[number];
|
||||
|
||||
// https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#standard-token-types-and-modifiers
|
||||
const vsCodeTokenTypeLiterals = ['type', 'event', 'label', 'macro'] as const;
|
||||
type VSCodeTokenType = (typeof vsCodeTokenTypeLiterals)[number];
|
||||
const vsCodeTokenIndex = vsCodeTokenTypeLiterals.reduce((acc, curr, index) => {
|
||||
acc[curr] = index;
|
||||
return acc;
|
||||
}, {} as Record<VSCodeTokenType, number>);
|
||||
|
||||
const arduinoToVSCodeMappings: Record<ArduinoTokenType, VSCodeTokenType> = {
|
||||
_hints: 'event',
|
||||
type: 'type',
|
||||
built_in: 'type',
|
||||
literal: 'macro',
|
||||
};
|
||||
|
||||
let _tokens: Map<string, ArduinoTokenType> | undefined;
|
||||
function getTokenType(word: string): VSCodeTokenType | undefined {
|
||||
if (!_tokens) {
|
||||
const tokens = new Map();
|
||||
for (const [type, words] of Object.entries(arduinoKeywords)) {
|
||||
words.forEach((w) => tokens.set(w, type));
|
||||
}
|
||||
_tokens = tokens;
|
||||
}
|
||||
const token = _tokens.get(word);
|
||||
if (!token) {
|
||||
return undefined;
|
||||
}
|
||||
return arduinoToVSCodeMappings[token];
|
||||
}
|
||||
|
||||
// Based on https://github.com/highlightjs/highlight.js/blob/6317acd780bfe448f75393ea42d53c0149013274/src/languages/arduino.js#L13-L378
|
||||
const arduinoKeywords = {
|
||||
type: ['boolean', 'byte', 'word', 'String'],
|
||||
built_in: [
|
||||
'KeyboardController',
|
||||
'MouseController',
|
||||
'SoftwareSerial',
|
||||
'EthernetServer',
|
||||
'EthernetClient',
|
||||
'LiquidCrystal',
|
||||
'RobotControl',
|
||||
'GSMVoiceCall',
|
||||
'EthernetUDP',
|
||||
'EsploraTFT',
|
||||
'HttpClient',
|
||||
'RobotMotor',
|
||||
'WiFiClient',
|
||||
'GSMScanner',
|
||||
'FileSystem',
|
||||
'Scheduler',
|
||||
'GSMServer',
|
||||
'YunClient',
|
||||
'YunServer',
|
||||
'IPAddress',
|
||||
'GSMClient',
|
||||
'GSMModem',
|
||||
'Keyboard',
|
||||
'Ethernet',
|
||||
'Console',
|
||||
'GSMBand',
|
||||
'Esplora',
|
||||
'Stepper',
|
||||
'Process',
|
||||
'WiFiUDP',
|
||||
'GSM_SMS',
|
||||
'Mailbox',
|
||||
'USBHost',
|
||||
'Firmata',
|
||||
'PImage',
|
||||
'Client',
|
||||
'Server',
|
||||
'GSMPIN',
|
||||
'FileIO',
|
||||
'Bridge',
|
||||
'Serial',
|
||||
'EEPROM',
|
||||
'Stream',
|
||||
'Mouse',
|
||||
'Audio',
|
||||
'Servo',
|
||||
'File',
|
||||
'Task',
|
||||
'GPRS',
|
||||
'WiFi',
|
||||
'Wire',
|
||||
'TFT',
|
||||
'GSM',
|
||||
'SPI',
|
||||
'SD',
|
||||
],
|
||||
_hints: [
|
||||
'setup',
|
||||
'loop',
|
||||
'runShellCommandAsynchronously',
|
||||
'analogWriteResolution',
|
||||
'retrieveCallingNumber',
|
||||
'printFirmwareVersion',
|
||||
'analogReadResolution',
|
||||
'sendDigitalPortPair',
|
||||
'noListenOnLocalhost',
|
||||
'readJoystickButton',
|
||||
'setFirmwareVersion',
|
||||
'readJoystickSwitch',
|
||||
'scrollDisplayRight',
|
||||
'getVoiceCallStatus',
|
||||
'scrollDisplayLeft',
|
||||
'writeMicroseconds',
|
||||
'delayMicroseconds',
|
||||
'beginTransmission',
|
||||
'getSignalStrength',
|
||||
'runAsynchronously',
|
||||
'getAsynchronously',
|
||||
'listenOnLocalhost',
|
||||
'getCurrentCarrier',
|
||||
'readAccelerometer',
|
||||
'messageAvailable',
|
||||
'sendDigitalPorts',
|
||||
'lineFollowConfig',
|
||||
'countryNameWrite',
|
||||
'runShellCommand',
|
||||
'readStringUntil',
|
||||
'rewindDirectory',
|
||||
'readTemperature',
|
||||
'setClockDivider',
|
||||
'readLightSensor',
|
||||
'endTransmission',
|
||||
'analogReference',
|
||||
'detachInterrupt',
|
||||
'countryNameRead',
|
||||
'attachInterrupt',
|
||||
'encryptionType',
|
||||
'readBytesUntil',
|
||||
'robotNameWrite',
|
||||
'readMicrophone',
|
||||
'robotNameRead',
|
||||
'cityNameWrite',
|
||||
'userNameWrite',
|
||||
'readJoystickY',
|
||||
'readJoystickX',
|
||||
'mouseReleased',
|
||||
'openNextFile',
|
||||
'scanNetworks',
|
||||
'noInterrupts',
|
||||
'digitalWrite',
|
||||
'beginSpeaker',
|
||||
'mousePressed',
|
||||
'isActionDone',
|
||||
'mouseDragged',
|
||||
'displayLogos',
|
||||
'noAutoscroll',
|
||||
'addParameter',
|
||||
'remoteNumber',
|
||||
'getModifiers',
|
||||
'keyboardRead',
|
||||
'userNameRead',
|
||||
'waitContinue',
|
||||
'processInput',
|
||||
'parseCommand',
|
||||
'printVersion',
|
||||
'readNetworks',
|
||||
'writeMessage',
|
||||
'blinkVersion',
|
||||
'cityNameRead',
|
||||
'readMessage',
|
||||
'setDataMode',
|
||||
'parsePacket',
|
||||
'isListening',
|
||||
'setBitOrder',
|
||||
'beginPacket',
|
||||
'isDirectory',
|
||||
'motorsWrite',
|
||||
'drawCompass',
|
||||
'digitalRead',
|
||||
'clearScreen',
|
||||
'serialEvent',
|
||||
'rightToLeft',
|
||||
'setTextSize',
|
||||
'leftToRight',
|
||||
'requestFrom',
|
||||
'keyReleased',
|
||||
'compassRead',
|
||||
'analogWrite',
|
||||
'interrupts',
|
||||
'WiFiServer',
|
||||
'disconnect',
|
||||
'playMelody',
|
||||
'parseFloat',
|
||||
'autoscroll',
|
||||
'getPINUsed',
|
||||
'setPINUsed',
|
||||
'setTimeout',
|
||||
'sendAnalog',
|
||||
'readSlider',
|
||||
'analogRead',
|
||||
'beginWrite',
|
||||
'createChar',
|
||||
'motorsStop',
|
||||
'keyPressed',
|
||||
'tempoWrite',
|
||||
'readButton',
|
||||
'subnetMask',
|
||||
'debugPrint',
|
||||
'macAddress',
|
||||
'writeGreen',
|
||||
'randomSeed',
|
||||
'attachGPRS',
|
||||
'readString',
|
||||
'sendString',
|
||||
'remotePort',
|
||||
'releaseAll',
|
||||
'mouseMoved',
|
||||
'background',
|
||||
'getXChange',
|
||||
'getYChange',
|
||||
'answerCall',
|
||||
'getResult',
|
||||
'voiceCall',
|
||||
'endPacket',
|
||||
'constrain',
|
||||
'getSocket',
|
||||
'writeJSON',
|
||||
'getButton',
|
||||
'available',
|
||||
'connected',
|
||||
'findUntil',
|
||||
'readBytes',
|
||||
'exitValue',
|
||||
'readGreen',
|
||||
'writeBlue',
|
||||
'startLoop',
|
||||
'IPAddress',
|
||||
'isPressed',
|
||||
'sendSysex',
|
||||
'pauseMode',
|
||||
'gatewayIP',
|
||||
'setCursor',
|
||||
'getOemKey',
|
||||
'tuneWrite',
|
||||
'noDisplay',
|
||||
'loadImage',
|
||||
'switchPIN',
|
||||
'onRequest',
|
||||
'onReceive',
|
||||
'changePIN',
|
||||
'playFile',
|
||||
'noBuffer',
|
||||
'parseInt',
|
||||
'overflow',
|
||||
'checkPIN',
|
||||
'knobRead',
|
||||
'beginTFT',
|
||||
'bitClear',
|
||||
'updateIR',
|
||||
'bitWrite',
|
||||
'position',
|
||||
'writeRGB',
|
||||
'highByte',
|
||||
'writeRed',
|
||||
'setSpeed',
|
||||
'readBlue',
|
||||
'noStroke',
|
||||
'remoteIP',
|
||||
'transfer',
|
||||
'shutdown',
|
||||
'hangCall',
|
||||
'beginSMS',
|
||||
'endWrite',
|
||||
'attached',
|
||||
'maintain',
|
||||
'noCursor',
|
||||
'checkReg',
|
||||
'checkPUK',
|
||||
'shiftOut',
|
||||
'isValid',
|
||||
'shiftIn',
|
||||
'pulseIn',
|
||||
'connect',
|
||||
'println',
|
||||
'localIP',
|
||||
'pinMode',
|
||||
'getIMEI',
|
||||
'display',
|
||||
'noBlink',
|
||||
'process',
|
||||
'getBand',
|
||||
'running',
|
||||
'beginSD',
|
||||
'drawBMP',
|
||||
'lowByte',
|
||||
'setBand',
|
||||
'release',
|
||||
'bitRead',
|
||||
'prepare',
|
||||
'pointTo',
|
||||
'readRed',
|
||||
'setMode',
|
||||
'noFill',
|
||||
'remove',
|
||||
'listen',
|
||||
'stroke',
|
||||
'detach',
|
||||
'attach',
|
||||
'noTone',
|
||||
'exists',
|
||||
'buffer',
|
||||
'height',
|
||||
'bitSet',
|
||||
'circle',
|
||||
'config',
|
||||
'cursor',
|
||||
'random',
|
||||
'IRread',
|
||||
'setDNS',
|
||||
'endSMS',
|
||||
'getKey',
|
||||
'micros',
|
||||
'millis',
|
||||
'begin',
|
||||
'print',
|
||||
'write',
|
||||
'ready',
|
||||
'flush',
|
||||
'width',
|
||||
'isPIN',
|
||||
'blink',
|
||||
'clear',
|
||||
'press',
|
||||
'mkdir',
|
||||
'rmdir',
|
||||
'close',
|
||||
'point',
|
||||
'yield',
|
||||
'image',
|
||||
'BSSID',
|
||||
'click',
|
||||
'delay',
|
||||
'read',
|
||||
'text',
|
||||
'move',
|
||||
'peek',
|
||||
'beep',
|
||||
'rect',
|
||||
'line',
|
||||
'open',
|
||||
'seek',
|
||||
'fill',
|
||||
'size',
|
||||
'turn',
|
||||
'stop',
|
||||
'home',
|
||||
'find',
|
||||
'step',
|
||||
'tone',
|
||||
'sqrt',
|
||||
'RSSI',
|
||||
'SSID',
|
||||
'end',
|
||||
'bit',
|
||||
'tan',
|
||||
'cos',
|
||||
'sin',
|
||||
'pow',
|
||||
'map',
|
||||
'abs',
|
||||
'max',
|
||||
'min',
|
||||
'get',
|
||||
'run',
|
||||
'put',
|
||||
],
|
||||
literal: [
|
||||
'DIGITAL_MESSAGE',
|
||||
'FIRMATA_STRING',
|
||||
'ANALOG_MESSAGE',
|
||||
'REPORT_DIGITAL',
|
||||
'REPORT_ANALOG',
|
||||
'INPUT_PULLUP',
|
||||
'SET_PIN_MODE',
|
||||
'INTERNAL2V56',
|
||||
'SYSTEM_RESET',
|
||||
'LED_BUILTIN',
|
||||
'INTERNAL1V1',
|
||||
'SYSEX_START',
|
||||
'INTERNAL',
|
||||
'EXTERNAL',
|
||||
'DEFAULT',
|
||||
'OUTPUT',
|
||||
'INPUT',
|
||||
'HIGH',
|
||||
'LOW',
|
||||
],
|
||||
} as const;
|
||||
@@ -6,19 +6,23 @@ import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import { Mutex } from 'async-mutex';
|
||||
import {
|
||||
ArduinoDaemon,
|
||||
assertSanitizedFqbn,
|
||||
BoardIdentifier,
|
||||
BoardsService,
|
||||
ExecutableService,
|
||||
isBoardIdentifierChangeEvent,
|
||||
sanitizeFqbn,
|
||||
} from '../../common/protocol';
|
||||
import { CurrentSketch } from '../sketches-service-client-impl';
|
||||
import {
|
||||
defaultAsyncWorkers,
|
||||
maxAsyncWorkers,
|
||||
minAsyncWorkers,
|
||||
} from '../arduino-preferences';
|
||||
import { BoardsDataStore } from '../boards/boards-data-store';
|
||||
import { BoardsServiceProvider } from '../boards/boards-service-provider';
|
||||
import { HostedPluginEvents } from '../hosted/hosted-plugin-events';
|
||||
import { NotificationCenter } from '../notification-center';
|
||||
import { CurrentSketch } from '../sketches-service-client-impl';
|
||||
import { SketchContribution, URI } from './contribution';
|
||||
import { BoardsDataStore } from '../boards/boards-data-store';
|
||||
|
||||
interface DaemonAddress {
|
||||
/**
|
||||
@@ -76,6 +80,10 @@ interface StartLanguageServerParams {
|
||||
* If `true`, the logging is not forwarded to the _Output_ view via the language client.
|
||||
*/
|
||||
readonly silentOutput?: boolean;
|
||||
/**
|
||||
* Number of async workers used by `clangd`. Background index also uses this many workers. If `0`, `clangd` uses all available cores. It's `0` by default.
|
||||
*/
|
||||
readonly jobs?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,6 +145,7 @@ export class InoLanguage extends SketchContribution {
|
||||
switch (preferenceName) {
|
||||
case 'arduino.language.log':
|
||||
case 'arduino.language.realTimeDiagnostics':
|
||||
case 'arduino.language.asyncWorkers':
|
||||
forceRestart();
|
||||
}
|
||||
}
|
||||
@@ -149,14 +158,11 @@ export class InoLanguage extends SketchContribution {
|
||||
this.notificationCenter.onDidReinitialize(() => forceRestart()),
|
||||
this.boardDataStore.onDidChange((event) => {
|
||||
if (this.languageServerFqbn) {
|
||||
const sanitizedFqbn = sanitizeFqbn(this.languageServerFqbn);
|
||||
if (!sanitizeFqbn) {
|
||||
throw new Error(
|
||||
`Failed to sanitize the FQBN of the running language server. FQBN with the board settings was: ${this.languageServerFqbn}`
|
||||
);
|
||||
}
|
||||
const sanitizedFQBN = sanitizeFqbn(this.languageServerFqbn);
|
||||
// The incoming FQBNs might contain custom boards configs, sanitize them before the comparison.
|
||||
// https://github.com/arduino/arduino-ide/pull/2113#pullrequestreview-1499998328
|
||||
const matchingChange = event.changes.find(
|
||||
(change) => change.fqbn === sanitizedFqbn
|
||||
(change) => sanitizedFQBN === sanitizeFqbn(change.fqbn)
|
||||
);
|
||||
const { boardsConfig } = this.boardsServiceProvider;
|
||||
if (
|
||||
@@ -168,9 +174,12 @@ export class InoLanguage extends SketchContribution {
|
||||
}
|
||||
}),
|
||||
]);
|
||||
this.boardsServiceProvider.ready.then(() =>
|
||||
start(this.boardsServiceProvider.boardsConfig.selectedBoard)
|
||||
);
|
||||
Promise.all([
|
||||
this.boardsServiceProvider.ready,
|
||||
this.preferences.ready,
|
||||
]).then(() => {
|
||||
start(this.boardsServiceProvider.boardsConfig.selectedBoard);
|
||||
});
|
||||
}
|
||||
|
||||
onStop(): void {
|
||||
@@ -183,11 +192,7 @@ export class InoLanguage extends SketchContribution {
|
||||
forceStart = false
|
||||
): Promise<void> {
|
||||
const port = await this.daemon.tryGetPort();
|
||||
if (!port) {
|
||||
return;
|
||||
}
|
||||
const portNumber = Number.parseInt(port, 10); // TODO: IDE2 APIs should provide a number and not string
|
||||
if (Number.isNaN(portNumber)) {
|
||||
if (typeof port !== 'number') {
|
||||
return;
|
||||
}
|
||||
const release = await this.languageServerStartMutex.acquire();
|
||||
@@ -219,7 +224,6 @@ export class InoLanguage extends SketchContribution {
|
||||
}
|
||||
return;
|
||||
}
|
||||
assertSanitizedFqbn(fqbn);
|
||||
const fqbnWithConfig = await this.boardDataStore.appendConfigToFqbn(fqbn);
|
||||
if (!fqbnWithConfig) {
|
||||
throw new Error(
|
||||
@@ -230,11 +234,16 @@ export class InoLanguage extends SketchContribution {
|
||||
// NOOP
|
||||
return;
|
||||
}
|
||||
this.logger.info(`Starting language server: ${fqbnWithConfig}`);
|
||||
const log = this.preferences.get('arduino.language.log');
|
||||
const realTimeDiagnostics = this.preferences.get(
|
||||
'arduino.language.realTimeDiagnostics'
|
||||
);
|
||||
const jobs = this.getAsyncWorkersPreferenceSafe();
|
||||
this.logger.info(
|
||||
`Starting language server: ${fqbnWithConfig}${
|
||||
jobs ? ` (async worker count: ${jobs})` : ''
|
||||
}`
|
||||
);
|
||||
let currentSketchPath: string | undefined = undefined;
|
||||
if (log) {
|
||||
const currentSketch = await this.sketchServiceClient.currentSketch();
|
||||
@@ -262,7 +271,7 @@ export class InoLanguage extends SketchContribution {
|
||||
lsPath,
|
||||
daemonAddress: {
|
||||
hostname: 'localhost',
|
||||
port: portNumber,
|
||||
port,
|
||||
instance: 1, // TODO: get it from the backend
|
||||
},
|
||||
clangdPath,
|
||||
@@ -273,6 +282,7 @@ export class InoLanguage extends SketchContribution {
|
||||
},
|
||||
realTimeDiagnostics,
|
||||
silentOutput: true,
|
||||
jobs,
|
||||
}),
|
||||
]);
|
||||
} catch (e) {
|
||||
@@ -283,6 +293,21 @@ export class InoLanguage extends SketchContribution {
|
||||
release();
|
||||
}
|
||||
}
|
||||
// The Theia preference UI validation is bogus.
|
||||
// To restrict the number of jobs to a valid value.
|
||||
private getAsyncWorkersPreferenceSafe(): number {
|
||||
const jobs = this.preferences.get(
|
||||
'arduino.language.asyncWorkers',
|
||||
defaultAsyncWorkers
|
||||
);
|
||||
if (jobs < minAsyncWorkers) {
|
||||
return minAsyncWorkers;
|
||||
}
|
||||
if (jobs > maxAsyncWorkers) {
|
||||
return maxAsyncWorkers;
|
||||
}
|
||||
return jobs;
|
||||
}
|
||||
|
||||
private async start(
|
||||
params: StartLanguageServerParams
|
||||
|
||||
@@ -3,10 +3,12 @@ import { NavigatableWidget } from '@theia/core/lib/browser/navigatable';
|
||||
import { Saveable } from '@theia/core/lib/browser/saveable';
|
||||
import { ApplicationShell } from '@theia/core/lib/browser/shell/application-shell';
|
||||
import { WindowService } from '@theia/core/lib/browser/window/window-service';
|
||||
import { ApplicationError } from '@theia/core/lib/common/application-error';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import { EditorManager } from '@theia/editor/lib/browser/editor-manager';
|
||||
import { WorkspaceInput } from '@theia/workspace/lib/browser/workspace-service';
|
||||
import { SketchesError } from '../../common/protocol';
|
||||
import { StartupTasks } from '../../electron-common/startup-task';
|
||||
import { ArduinoMenus } from '../menu/arduino-menus';
|
||||
import { CurrentSketch } from '../sketches-service-client-impl';
|
||||
@@ -35,7 +37,29 @@ export class SaveAsSketch extends CloudSketchContribution {
|
||||
|
||||
override registerCommands(registry: CommandRegistry): void {
|
||||
registry.registerCommand(SaveAsSketch.Commands.SAVE_AS_SKETCH, {
|
||||
execute: (args) => this.saveAs(args),
|
||||
execute: async (args) => {
|
||||
try {
|
||||
return await this.saveAs(args);
|
||||
} catch (err) {
|
||||
let message = String(err);
|
||||
if (ApplicationError.is(err)) {
|
||||
if (SketchesError.SketchAlreadyContainsThisFile.is(err)) {
|
||||
message = nls.localize(
|
||||
'arduino/sketch/sketchAlreadyContainsThisFileMessage',
|
||||
'Failed to save sketch "{0}" as "{1}". {2}',
|
||||
err.data.sourceSketchName,
|
||||
err.data.targetSketchName,
|
||||
err.message
|
||||
);
|
||||
} else {
|
||||
message = err.message;
|
||||
}
|
||||
} else if (err instanceof Error) {
|
||||
message = err.message;
|
||||
}
|
||||
this.messageService.error(message);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -58,13 +82,14 @@ export class SaveAsSketch extends CloudSketchContribution {
|
||||
* Resolves `true` if the sketch was successfully saved as something.
|
||||
*/
|
||||
private async saveAs(
|
||||
{
|
||||
params = SaveAsSketch.Options.DEFAULT
|
||||
): Promise<boolean> {
|
||||
const {
|
||||
execOnlyIfTemp,
|
||||
openAfterMove,
|
||||
wipeOriginal,
|
||||
markAsRecentlyOpened,
|
||||
}: SaveAsSketch.Options = SaveAsSketch.Options.DEFAULT
|
||||
): Promise<boolean> {
|
||||
} = params;
|
||||
assertConnectedToBackend({
|
||||
connectionStatusService: this.connectionStatusService,
|
||||
messageService: this.messageService,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Emitter } from '@theia/core/lib/common/event';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import { CoreService, sanitizeFqbn } from '../../common/protocol';
|
||||
import { FQBN } from 'fqbn';
|
||||
import { CoreService } from '../../common/protocol';
|
||||
import { ArduinoMenus } from '../menu/arduino-menus';
|
||||
import { CurrentSketch } from '../sketches-service-client-impl';
|
||||
import { ArduinoToolbar } from '../toolbar/arduino-toolbar';
|
||||
@@ -136,9 +137,10 @@ export class UploadSketch extends CoreServiceContribution {
|
||||
|
||||
const uploadResponse = await this.doWithProgress({
|
||||
progressText: nls.localize('arduino/sketch/uploading', 'Uploading...'),
|
||||
task: (progressId, coreService) =>
|
||||
coreService.upload({ ...uploadOptions, progressId }),
|
||||
task: (progressId, coreService, token) =>
|
||||
coreService.upload({ ...uploadOptions, progressId }, token),
|
||||
keepOutput: true,
|
||||
cancelable: true,
|
||||
});
|
||||
// the port update is NOOP if nothing has changed
|
||||
this.boardsServiceProvider.updateConfig(uploadResponse.portAfterUpload);
|
||||
@@ -172,7 +174,11 @@ export class UploadSketch extends CoreServiceContribution {
|
||||
const [fqbn, { selectedProgrammer: programmer }, verify, verbose] =
|
||||
await Promise.all([
|
||||
verifyOptions.fqbn, // already decorated FQBN
|
||||
this.boardsDataStore.getData(sanitizeFqbn(verifyOptions.fqbn)),
|
||||
this.boardsDataStore.getData(
|
||||
verifyOptions.fqbn
|
||||
? new FQBN(verifyOptions.fqbn).toString(true)
|
||||
: undefined
|
||||
),
|
||||
this.preferences.get('arduino.upload.verify'),
|
||||
this.preferences.get('arduino.upload.verbose'),
|
||||
]);
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import { Emitter } from '@theia/core/lib/common/event';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import type { CoreService } from '../../common/protocol';
|
||||
import { ArduinoMenus } from '../menu/arduino-menus';
|
||||
import { CurrentSketch } from '../sketches-service-client-impl';
|
||||
import { ArduinoToolbar } from '../toolbar/arduino-toolbar';
|
||||
import {
|
||||
CoreServiceContribution,
|
||||
Command,
|
||||
CommandRegistry,
|
||||
MenuModelRegistry,
|
||||
CoreServiceContribution,
|
||||
KeybindingRegistry,
|
||||
MenuModelRegistry,
|
||||
TabBarToolbarRegistry,
|
||||
} from './contribution';
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
import { CurrentSketch } from '../sketches-service-client-impl';
|
||||
import { CoreService } from '../../common/protocol';
|
||||
import { CoreErrorHandler } from './core-error-handler';
|
||||
|
||||
export interface VerifySketchParams {
|
||||
@@ -131,11 +131,15 @@ export class VerifySketch extends CoreServiceContribution {
|
||||
'arduino/sketch/compile',
|
||||
'Compiling sketch...'
|
||||
),
|
||||
task: (progressId, coreService) =>
|
||||
coreService.compile({
|
||||
...options,
|
||||
progressId,
|
||||
}),
|
||||
task: (progressId, coreService, token) =>
|
||||
coreService.compile(
|
||||
{
|
||||
...options,
|
||||
progressId,
|
||||
},
|
||||
token
|
||||
),
|
||||
cancelable: true,
|
||||
});
|
||||
this.messageService.info(
|
||||
nls.localize('arduino/sketch/doneCompiling', 'Done compiling.'),
|
||||
|
||||
@@ -1,35 +1,36 @@
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import URI from '@theia/core/lib/common/uri';
|
||||
import { Event } from '@theia/core/lib/common/event';
|
||||
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application';
|
||||
import {
|
||||
Disposable,
|
||||
DisposableCollection,
|
||||
} from '@theia/core/lib/common/disposable';
|
||||
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application';
|
||||
import {
|
||||
Stat,
|
||||
FileType,
|
||||
FileChange,
|
||||
FileWriteOptions,
|
||||
FileDeleteOptions,
|
||||
FileOverwriteOptions,
|
||||
FileSystemProvider,
|
||||
FileSystemProviderError,
|
||||
FileSystemProviderErrorCode,
|
||||
FileSystemProviderCapabilities,
|
||||
WatchOptions,
|
||||
} from '@theia/filesystem/lib/common/files';
|
||||
import { Event } from '@theia/core/lib/common/event';
|
||||
import URI from '@theia/core/lib/common/uri';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import {
|
||||
FileService,
|
||||
FileServiceContribution,
|
||||
} from '@theia/filesystem/lib/browser/file-service';
|
||||
import {
|
||||
FileChange,
|
||||
FileDeleteOptions,
|
||||
FileOverwriteOptions,
|
||||
FileSystemProvider,
|
||||
FileSystemProviderCapabilities,
|
||||
FileSystemProviderError,
|
||||
FileSystemProviderErrorCode,
|
||||
FileType,
|
||||
FileWriteOptions,
|
||||
Stat,
|
||||
WatchOptions,
|
||||
createFileSystemProviderError,
|
||||
} from '@theia/filesystem/lib/common/files';
|
||||
import { SketchesService } from '../../common/protocol';
|
||||
import { stringToUint8Array } from '../../common/utils';
|
||||
import { ArduinoPreferences } from '../arduino-preferences';
|
||||
import { AuthenticationClientService } from '../auth/authentication-client-service';
|
||||
import { CreateApi } from './create-api';
|
||||
import { CreateUri } from './create-uri';
|
||||
import { SketchesService } from '../../common/protocol';
|
||||
import { ArduinoPreferences } from '../arduino-preferences';
|
||||
import { Create } from './typings';
|
||||
import { stringToUint8Array } from '../../common/utils';
|
||||
import { Create, isNotFound } from './typings';
|
||||
|
||||
@injectable()
|
||||
export class CreateFsProvider
|
||||
@@ -90,14 +91,27 @@ export class CreateFsProvider
|
||||
size: 0,
|
||||
};
|
||||
}
|
||||
const resource = await this.getCreateApi.stat(uri.path.toString());
|
||||
const mtime = Date.parse(resource.modified_at);
|
||||
return {
|
||||
type: this.toFileType(resource.type),
|
||||
ctime: mtime,
|
||||
mtime,
|
||||
size: 0,
|
||||
};
|
||||
try {
|
||||
const resource = await this.getCreateApi.stat(uri.path.toString());
|
||||
const mtime = Date.parse(resource.modified_at);
|
||||
return {
|
||||
type: this.toFileType(resource.type),
|
||||
ctime: mtime,
|
||||
mtime,
|
||||
size: 0,
|
||||
};
|
||||
} catch (err) {
|
||||
let errToRethrow = err;
|
||||
// Not Found (Create API) errors must be remapped to VS Code filesystem provider specific errors
|
||||
// https://code.visualstudio.com/api/references/vscode-api#FileSystemError
|
||||
if (isNotFound(errToRethrow)) {
|
||||
errToRethrow = createFileSystemProviderError(
|
||||
errToRethrow,
|
||||
FileSystemProviderErrorCode.FileNotFound
|
||||
);
|
||||
}
|
||||
throw errToRethrow;
|
||||
}
|
||||
}
|
||||
|
||||
async mkdir(uri: URI): Promise<void> {
|
||||
|
||||
@@ -89,8 +89,7 @@
|
||||
"scope": [
|
||||
"storage",
|
||||
"support",
|
||||
"string.quoted.single.c",
|
||||
"macro"
|
||||
"string.quoted.single.c"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0ca1a6"
|
||||
@@ -102,8 +101,7 @@
|
||||
"meta.function.c",
|
||||
"entity.name.function",
|
||||
"meta.function-call.c",
|
||||
"variable.other",
|
||||
"label"
|
||||
"variable.other"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#F39C12"
|
||||
@@ -148,8 +146,7 @@
|
||||
"name": "meta keywords",
|
||||
"scope": [
|
||||
"keyword.control",
|
||||
"meta.preprocessor.c",
|
||||
"event"
|
||||
"meta.preprocessor.c"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#C586C0"
|
||||
|
||||
@@ -89,8 +89,7 @@
|
||||
"scope": [
|
||||
"storage",
|
||||
"support",
|
||||
"string.quoted.single.c",
|
||||
"macro"
|
||||
"string.quoted.single.c"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#00979D"
|
||||
@@ -102,8 +101,7 @@
|
||||
"meta.function.c",
|
||||
"entity.name.function",
|
||||
"meta.function-call.c",
|
||||
"variable.other",
|
||||
"label"
|
||||
"variable.other"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#D35400"
|
||||
@@ -148,8 +146,7 @@
|
||||
"name": "meta keywords",
|
||||
"scope": [
|
||||
"keyword.control",
|
||||
"meta.preprocessor.c",
|
||||
"event"
|
||||
"meta.preprocessor.c"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#728E00"
|
||||
|
||||
@@ -69,6 +69,7 @@ export const CertificateUploaderComponent = ({
|
||||
const onItemSelect = React.useCallback(
|
||||
(item: BoardOptionValue | null) => {
|
||||
if (!item) {
|
||||
setSelectedItem(null);
|
||||
return;
|
||||
}
|
||||
const board = item.board;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
import React from '@theia/core/shared/react';
|
||||
import type {
|
||||
BoardList,
|
||||
BoardListItemWithBoard,
|
||||
import {
|
||||
boardListItemEquals,
|
||||
type BoardList,
|
||||
type BoardListItemWithBoard,
|
||||
} from '../../../common/protocol/board-list';
|
||||
import { ArduinoSelect } from '../../widgets/arduino-select';
|
||||
|
||||
@@ -75,7 +76,9 @@ export const SelectBoardComponent = ({
|
||||
setSelectOptions(boardOptions);
|
||||
|
||||
if (selectedItem) {
|
||||
selBoard = updatableBoards.indexOf(selectedItem);
|
||||
selBoard = updatableBoards.findIndex((board) =>
|
||||
boardListItemEquals(board, selectedItem)
|
||||
);
|
||||
}
|
||||
|
||||
selectOption(boardOptions[selBoard] || null);
|
||||
|
||||
@@ -104,6 +104,7 @@ export const FirmwareUploaderComponent = ({
|
||||
const onItemSelect = React.useCallback(
|
||||
(item: BoardListItemWithBoard | null) => {
|
||||
if (!item) {
|
||||
setSelectedItem(null);
|
||||
return;
|
||||
}
|
||||
const board = item.board;
|
||||
|
||||
@@ -12,15 +12,13 @@ import {
|
||||
LibrarySearch,
|
||||
LibraryService,
|
||||
} from '../../common/protocol/library-service';
|
||||
import {
|
||||
ListWidget,
|
||||
UserAbortError,
|
||||
} from '../widgets/component-list/list-widget';
|
||||
import { ListWidget } from '../widgets/component-list/list-widget';
|
||||
import { Installable } from '../../common/protocol';
|
||||
import { ListItemRenderer } from '../widgets/component-list/list-item-renderer';
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
import { LibraryFilterRenderer } from '../widgets/component-list/filter-renderer';
|
||||
import { findChildTheiaButton, splitByBoldTag } from '../utils/dom';
|
||||
import { UserAbortError } from '../../common/protocol/progressible';
|
||||
|
||||
@injectable()
|
||||
export class LibraryListWidget extends ListWidget<
|
||||
|
||||
@@ -46,7 +46,7 @@ export class NotificationCenter
|
||||
new Emitter<ProgressMessage>();
|
||||
private readonly indexUpdateDidFailEmitter =
|
||||
new Emitter<IndexUpdateDidFailParams>();
|
||||
private readonly daemonDidStartEmitter = new Emitter<string>();
|
||||
private readonly daemonDidStartEmitter = new Emitter<number>();
|
||||
private readonly daemonDidStopEmitter = new Emitter<void>();
|
||||
private readonly configDidChangeEmitter = new Emitter<ConfigState>();
|
||||
private readonly platformDidInstallEmitter = new Emitter<{
|
||||
@@ -136,7 +136,7 @@ export class NotificationCenter
|
||||
this.indexUpdateDidFailEmitter.fire(params);
|
||||
}
|
||||
|
||||
notifyDaemonDidStart(port: string): void {
|
||||
notifyDaemonDidStart(port: number): void {
|
||||
this.daemonDidStartEmitter.fire(port);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,36 +1,13 @@
|
||||
/* TODO: remove after https://github.com/eclipse-theia/theia/pull/9256/ */
|
||||
|
||||
/* To fix colors in Theia. */
|
||||
.theia-debug-hover-title.number,
|
||||
.theia-debug-console-variable.number {
|
||||
color: var(--theia-variable-number-variable-color);
|
||||
}
|
||||
.theia-debug-hover-title.boolean,
|
||||
.theia-debug-console-variable.boolean {
|
||||
color: var(--theia-variable-boolean-variable-color);
|
||||
}
|
||||
.theia-debug-hover-title.string,
|
||||
.theia-debug-console-variable.string {
|
||||
color: var(--theia-variable-string-variable-color);
|
||||
/* Naive way of hiding the debug widget when the debug functionality is disabled https://github.com/arduino/arduino-ide/issues/14 */
|
||||
.theia-debug-container .debug-toolbar.hidden,
|
||||
.theia-debug-container .theia-session-container.hidden {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* To unset the default debug hover dimension. */
|
||||
.theia-debug-hover {
|
||||
min-width: unset;
|
||||
min-height: unset;
|
||||
width: unset;
|
||||
height: unset;
|
||||
}
|
||||
.theia-debug-container .status-message {
|
||||
font-family: "Open Sans";
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
|
||||
/* To adjust the left padding in the hover title. */
|
||||
.theia-debug-hover-title {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
/* Use the default Theia dimensions only iff the expression is complex (`!!expression.hasChildren~) */
|
||||
.theia-debug-hover.complex-value {
|
||||
min-width: 324px;
|
||||
min-height: 324px;
|
||||
width: 324px;
|
||||
height: 324px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ export class DaemonPort implements FrontendApplicationContribution {
|
||||
@inject(NotificationCenter)
|
||||
private readonly notificationCenter: NotificationCenter;
|
||||
|
||||
private readonly onPortDidChangeEmitter = new Emitter<string | undefined>();
|
||||
private _port: string | undefined;
|
||||
private readonly onPortDidChangeEmitter = new Emitter<number | undefined>();
|
||||
private _port: number | undefined;
|
||||
|
||||
onStart(): void {
|
||||
this.daemon.tryGetPort().then(
|
||||
@@ -91,15 +91,15 @@ export class DaemonPort implements FrontendApplicationContribution {
|
||||
this.onPortDidChangeEmitter.dispose();
|
||||
}
|
||||
|
||||
get port(): string | undefined {
|
||||
get port(): number | undefined {
|
||||
return this._port;
|
||||
}
|
||||
|
||||
get onDidChangePort(): Event<string | undefined> {
|
||||
get onDidChangePort(): Event<number | undefined> {
|
||||
return this.onPortDidChangeEmitter.event;
|
||||
}
|
||||
|
||||
private setPort(port: string | undefined): void {
|
||||
private setPort(port: number | undefined): void {
|
||||
const oldPort = this._port;
|
||||
this._port = port;
|
||||
if (this._port !== oldPort) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { SelectOption } from '@theia/core/lib/browser/widgets/select-component';
|
||||
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import { injectable } from '@theia/core/shared/inversify';
|
||||
@@ -51,6 +52,24 @@ class DebugConfigurationSelect extends TheiaDebugConfigurationSelect {
|
||||
);
|
||||
}
|
||||
|
||||
protected override renderOptions(): SelectOption[] {
|
||||
const options = super.renderOptions();
|
||||
const addConfiguration = options[options.length - 1];
|
||||
const separator = options[options.length - 2];
|
||||
// Remove "Add configuration..." and the preceding separator options.
|
||||
// They're expected to be the last two items.
|
||||
if (
|
||||
addConfiguration.value ===
|
||||
TheiaDebugConfigurationSelect.ADD_CONFIGURATION &&
|
||||
separator.separator
|
||||
) {
|
||||
options.splice(options.length - 2, 2);
|
||||
return options;
|
||||
}
|
||||
// Something is unexpected with the select options.
|
||||
return options;
|
||||
}
|
||||
|
||||
override componentWillUnmount(): void {
|
||||
this.toDisposeOnUnmount.dispose();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
import { codicon } from '@theia/core/lib/browser/widgets/widget';
|
||||
import { Widget } from '@theia/core/shared/@phosphor/widgets';
|
||||
import {
|
||||
inject,
|
||||
injectable,
|
||||
postConstruct,
|
||||
} from '@theia/core/shared/inversify';
|
||||
import { DebugWidget as TheiaDebugWidget } from '@theia/debug/lib/browser/view/debug-widget';
|
||||
import { DebugDisabledStatusMessageSource } from '../../contributions/debug';
|
||||
import {
|
||||
removeWidgetIfPresent,
|
||||
unshiftWidgetIfNotPresent,
|
||||
} from '../dialogs/widgets';
|
||||
|
||||
@injectable()
|
||||
export class DebugWidget extends TheiaDebugWidget {
|
||||
@inject(DebugDisabledStatusMessageSource)
|
||||
private readonly debugStatusMessageSource: DebugDisabledStatusMessageSource;
|
||||
|
||||
private readonly statusMessageWidget = new Widget();
|
||||
private readonly messageNode = document.createElement('div');
|
||||
|
||||
@postConstruct()
|
||||
protected override init(): void {
|
||||
super.init();
|
||||
this.messageNode.classList.add('status-message', 'noselect');
|
||||
this.statusMessageWidget.node.appendChild(this.messageNode);
|
||||
this.updateState();
|
||||
this.toDisposeOnDetach.pushAll([
|
||||
this.debugStatusMessageSource.onDidChangeMessage((message) =>
|
||||
this.updateState(message)
|
||||
),
|
||||
this.statusMessageWidget,
|
||||
]);
|
||||
}
|
||||
|
||||
private updateState(message = this.debugStatusMessageSource.message): void {
|
||||
requestAnimationFrame(() => {
|
||||
this.messageNode.textContent = message ?? '';
|
||||
const enabled = !message;
|
||||
updateVisibility(enabled, this.toolbar, this.sessionWidget);
|
||||
if (enabled) {
|
||||
removeWidgetIfPresent(this.layout, this.statusMessageWidget);
|
||||
} else {
|
||||
unshiftWidgetIfNotPresent(this.layout, this.statusMessageWidget);
|
||||
}
|
||||
this.title.iconClass = enabled ? codicon('debug-alt') : 'fa fa-ban'; // TODO: find a better icon?
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updateVisibility(visible: boolean, ...widgets: Widget[]): void {
|
||||
widgets.forEach((widget) =>
|
||||
visible ? widget.removeClass('hidden') : widget.addClass('hidden')
|
||||
);
|
||||
}
|
||||
51
arduino-ide-extension/src/browser/theia/dialogs/widgets.ts
Normal file
51
arduino-ide-extension/src/browser/theia/dialogs/widgets.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import {
|
||||
Layout,
|
||||
PanelLayout,
|
||||
Widget,
|
||||
} from '@theia/core/shared/@phosphor/widgets';
|
||||
|
||||
/**
|
||||
*
|
||||
* Removes the widget from the layout if the `layout` is a `PanelLayout` and the widget is present in the layout.
|
||||
* Otherwise, it's NOOP
|
||||
* @param layout the layout to remove the widget from. Must be a `PanelLayout`.
|
||||
* @param toRemove the widget to remove from the layout
|
||||
*/
|
||||
export function removeWidgetIfPresent(
|
||||
layout: Layout | null,
|
||||
toRemove: Widget
|
||||
): void {
|
||||
if (layout instanceof PanelLayout) {
|
||||
const index = layout.widgets.indexOf(toRemove);
|
||||
if (index < 0) {
|
||||
// Unlike the default `PanelLayout#removeWidget` behavior, (https://github.com/phosphorjs/phosphor/blob/9f5e11025b62d2c4a6fb59e2681ae1ed323dcde4/packages/widgets/src/panellayout.ts#L154-L156)
|
||||
// do not try to remove widget if it's not present (the index is negative).
|
||||
// Otherwise, required widgets could be removed based on the default ArrayExt behavior (https://github.com/phosphorjs/phosphor/blob/9f5e11025b62d2c4a6fb59e2681ae1ed323dcde4/packages/algorithm/src/array.ts#L1075-L1077)
|
||||
// See https://github.com/arduino/arduino-ide/issues/2354 for more details.
|
||||
return;
|
||||
}
|
||||
layout.removeWidget(toRemove);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Inserts the widget to the `0` index of the layout if the `layout` is a `PanelLayout` and the widget is not yet part of the layout.
|
||||
* Otherwise, it's NOOP
|
||||
* @param layout the layout to add the widget to. Must be a `PanelLayout`.
|
||||
* @param toAdd the widget to add to the layout
|
||||
*/
|
||||
export function unshiftWidgetIfNotPresent(
|
||||
layout: Layout | null,
|
||||
toAdd: Widget
|
||||
): void {
|
||||
if (layout instanceof PanelLayout) {
|
||||
const index = layout.widgets.indexOf(toAdd);
|
||||
if (index >= 0) {
|
||||
// Do not try to add the widget to the layout if it's already present.
|
||||
// This is the counterpart logic of the `removeWidgetIfPresent` function.
|
||||
return;
|
||||
}
|
||||
layout.insertWidget(0, toAdd);
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,13 @@ export class WorkspaceCommandContribution extends TheiaWorkspaceCommandContribut
|
||||
execute: (uri) => this.newFile(uri),
|
||||
})
|
||||
);
|
||||
registry.unregisterCommand(WorkspaceCommands.NEW_FOLDER);
|
||||
registry.registerCommand(
|
||||
WorkspaceCommands.NEW_FOLDER,
|
||||
this.newWorkspaceRootUriAwareCommandHandler({
|
||||
execute: (uri) => this.newFolder(uri),
|
||||
})
|
||||
);
|
||||
registry.unregisterCommand(WorkspaceCommands.FILE_RENAME);
|
||||
registry.registerCommand(
|
||||
WorkspaceCommands.FILE_RENAME,
|
||||
@@ -72,6 +79,37 @@ export class WorkspaceCommandContribution extends TheiaWorkspaceCommandContribut
|
||||
);
|
||||
}
|
||||
|
||||
private async newFolder(uri: URI | undefined): Promise<void> {
|
||||
if (!uri) {
|
||||
return;
|
||||
}
|
||||
|
||||
const parent = await this.getDirectory(uri);
|
||||
if (!parent) {
|
||||
return;
|
||||
}
|
||||
|
||||
const dialog = new WorkspaceInputDialog(
|
||||
{
|
||||
title: nls.localizeByDefault('New Folder...'),
|
||||
parentUri: uri,
|
||||
placeholder: nls.localize(
|
||||
'theia/workspace/newFolderPlaceholder',
|
||||
'Folder Name'
|
||||
),
|
||||
validate: (name) => this.validateFileName(name, parent, true),
|
||||
},
|
||||
this.labelProvider
|
||||
);
|
||||
const name = await this.openDialog(dialog, uri);
|
||||
if (!name) {
|
||||
return;
|
||||
}
|
||||
const folderUri = uri.resolve(name);
|
||||
await this.fileService.createFolder(folderUri);
|
||||
this.fireCreateNewFile({ parent: uri, uri: folderUri });
|
||||
}
|
||||
|
||||
private async newFile(uri: URI | undefined): Promise<void> {
|
||||
if (!uri) {
|
||||
return;
|
||||
|
||||
@@ -389,21 +389,28 @@ export class CloudSketchbookTree extends SketchbookTree {
|
||||
|
||||
private async sync(source: URI, dest: URI): Promise<void> {
|
||||
const { filesToWrite, filesToDelete } = await this.treeDiff(source, dest);
|
||||
await Promise.all(
|
||||
filesToWrite.map(async ({ source, dest }) => {
|
||||
if ((await this.fileService.resolve(source)).isFile) {
|
||||
const content = await this.fileService.read(source);
|
||||
return this.fileService.write(dest, content.value);
|
||||
}
|
||||
return this.fileService.createFolder(dest);
|
||||
})
|
||||
// Sort by the URIs. The shortest comes first. It's to ensure creating the parent folder for nested resources, for example.
|
||||
// When sorting the URIs, it does not matter whether on source or dest, only the URI path and its length matters; they're the same for a source+dest pair
|
||||
const uriPathLengthComparator = (left: URI, right: URI) =>
|
||||
left.path.toString().length - right.path.toString().length;
|
||||
filesToWrite.sort((left, right) =>
|
||||
uriPathLengthComparator(left.source, right.source)
|
||||
);
|
||||
for (const { source, dest } of filesToWrite) {
|
||||
const stat = await this.fileService.resolve(source);
|
||||
if (stat.isFile) {
|
||||
const content = await this.fileService.read(source);
|
||||
await this.fileService.write(dest, content.value);
|
||||
} else {
|
||||
await this.fileService.createFolder(dest);
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.all(
|
||||
filesToDelete.map((file) =>
|
||||
this.fileService.delete(file, { recursive: true })
|
||||
)
|
||||
);
|
||||
// Longes URI paths come first to delete the most nested ones first.
|
||||
filesToDelete.sort(uriPathLengthComparator).reverse();
|
||||
for (const resource of filesToDelete) {
|
||||
await this.fileService.delete(resource, { recursive: true });
|
||||
}
|
||||
}
|
||||
|
||||
override async resolveChildren(
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from '@theia/core/shared/react';
|
||||
import type { ArduinoComponent } from '../../../common/protocol/arduino-component';
|
||||
import { Installable } from '../../../common/protocol/installable';
|
||||
import type { ListItemRenderer } from './list-item-renderer';
|
||||
import { UserAbortError } from './list-widget';
|
||||
import { UserAbortError } from '../../../common/protocol/progressible';
|
||||
|
||||
export class ComponentListItem<
|
||||
T extends ArduinoComponent
|
||||
|
||||
@@ -5,7 +5,10 @@ import { CommandService } from '@theia/core/lib/common/command';
|
||||
import { MessageService } from '@theia/core/lib/common/message-service';
|
||||
import { ConfirmDialog } from '@theia/core/lib/browser/dialogs';
|
||||
import { Searchable } from '../../../common/protocol/searchable';
|
||||
import { ExecuteWithProgress } from '../../../common/protocol/progressible';
|
||||
import {
|
||||
ExecuteWithProgress,
|
||||
UserAbortError,
|
||||
} from '../../../common/protocol/progressible';
|
||||
import {
|
||||
Installable,
|
||||
libraryInstallFailed,
|
||||
@@ -13,7 +16,7 @@ import {
|
||||
} from '../../../common/protocol/installable';
|
||||
import { ArduinoComponent } from '../../../common/protocol/arduino-component';
|
||||
import { SearchBar } from './search-bar';
|
||||
import { ListWidget, UserAbortError } from './list-widget';
|
||||
import { ListWidget } from './list-widget';
|
||||
import { ComponentList } from './component-list';
|
||||
import { ListItemRenderer } from './list-item-renderer';
|
||||
import {
|
||||
|
||||
@@ -192,10 +192,3 @@ export namespace ListWidget {
|
||||
readonly defaultSearchOptions: S;
|
||||
}
|
||||
}
|
||||
|
||||
export class UserAbortError extends Error {
|
||||
constructor(message = 'User abort') {
|
||||
super(message);
|
||||
Object.setPrototypeOf(this, UserAbortError.prototype);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,14 @@ export namespace SketchbookCommands {
|
||||
'arduino/sketch/openFolder'
|
||||
);
|
||||
|
||||
export const NEW_FOLDER = Command.toLocalizedCommand(
|
||||
{
|
||||
id: 'arduino-sketchbook--new-folder',
|
||||
label: 'New Folder',
|
||||
},
|
||||
'arduino/sketch/newFolder'
|
||||
);
|
||||
|
||||
export const OPEN_SKETCHBOOK_CONTEXT_MENU: Command = {
|
||||
id: 'arduino-sketchbook--open-sketch-context-menu',
|
||||
iconClass: 'sketchbook-tree__opts',
|
||||
|
||||
@@ -28,7 +28,10 @@ import {
|
||||
} from '../../sketches-service-client-impl';
|
||||
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
||||
import { URI } from '../../contributions/contribution';
|
||||
import { WorkspaceInput } from '@theia/workspace/lib/browser';
|
||||
import {
|
||||
WorkspaceCommands,
|
||||
WorkspaceInput,
|
||||
} from '@theia/workspace/lib/browser';
|
||||
|
||||
export const SKETCHBOOK__CONTEXT = ['arduino-sketchbook--context'];
|
||||
|
||||
@@ -130,6 +133,21 @@ export class SketchbookWidgetContribution
|
||||
!!arg && 'node' in arg && SketchbookTree.SketchDirNode.is(arg.node),
|
||||
});
|
||||
|
||||
registry.registerCommand(SketchbookCommands.NEW_FOLDER, {
|
||||
execute: async (arg) => {
|
||||
if (arg.node.uri) {
|
||||
return registry.executeCommand(
|
||||
WorkspaceCommands.NEW_FOLDER.id,
|
||||
arg.node.uri
|
||||
);
|
||||
}
|
||||
},
|
||||
isEnabled: (arg) =>
|
||||
!!arg && 'node' in arg && SketchbookTree.SketchDirNode.is(arg.node),
|
||||
isVisible: (arg) =>
|
||||
!!arg && 'node' in arg && SketchbookTree.SketchDirNode.is(arg.node),
|
||||
});
|
||||
|
||||
registry.registerCommand(SketchbookCommands.OPEN_SKETCHBOOK_CONTEXT_MENU, {
|
||||
isEnabled: (arg) =>
|
||||
!!arg && 'node' in arg && SketchbookTree.SketchDirNode.is(arg.node),
|
||||
@@ -206,6 +224,12 @@ export class SketchbookWidgetContribution
|
||||
label: SketchbookCommands.REVEAL_IN_FINDER.label,
|
||||
order: '0',
|
||||
});
|
||||
|
||||
registry.registerMenuAction(SKETCHBOOK__CONTEXT__MAIN_GROUP, {
|
||||
commandId: SketchbookCommands.NEW_FOLDER.id,
|
||||
label: SketchbookCommands.NEW_FOLDER.label,
|
||||
order: '1',
|
||||
});
|
||||
}
|
||||
|
||||
private openNewWindow(
|
||||
|
||||
@@ -39,3 +39,5 @@ export const noSketchOpened = nls.localize(
|
||||
'arduino/common/noSketchOpened',
|
||||
'No sketch opened'
|
||||
);
|
||||
|
||||
export const userAbort = nls.localize('arduino/common/userAbort', 'User abort');
|
||||
|
||||
@@ -5,14 +5,14 @@ export interface ArduinoDaemon {
|
||||
* Returns with a promise that resolves with the port
|
||||
* of the CLI daemon when it's up and running.
|
||||
*/
|
||||
getPort(): Promise<string>;
|
||||
getPort(): Promise<number>;
|
||||
/**
|
||||
* Unlike `getPort` this method returns with a promise
|
||||
* that resolves to `undefined` when the daemon is not running.
|
||||
* Otherwise resolves to the CLI daemon port.
|
||||
*/
|
||||
tryGetPort(): Promise<string | undefined>;
|
||||
start(): Promise<string>;
|
||||
tryGetPort(): Promise<number | undefined>;
|
||||
start(): Promise<number>;
|
||||
stop(): Promise<void>;
|
||||
restart(): Promise<string>;
|
||||
restart(): Promise<number>;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import { FQBN } from 'fqbn';
|
||||
import type { MaybePromise } from '@theia/core/lib/common/types';
|
||||
import type URI from '@theia/core/lib/common/uri';
|
||||
import {
|
||||
@@ -75,6 +76,9 @@ export interface BoardsService
|
||||
}): Promise<BoardsPackage | undefined>;
|
||||
searchBoards({ query }: { query?: string }): Promise<BoardWithPackage[]>;
|
||||
getInstalledBoards(): Promise<BoardWithPackage[]>;
|
||||
/**
|
||||
* Returns with all installed platforms including the manually installed ones.
|
||||
*/
|
||||
getInstalledPlatforms(): Promise<BoardsPackage[]>;
|
||||
getBoardUserFields(options: {
|
||||
fqbn: string;
|
||||
@@ -95,7 +99,7 @@ export interface CheckDebugEnabledParams {
|
||||
* The FQBN might contain custom board config options. For example, `arduino:esp32:nano_nora:USBMode=hwcdc,option2=value2`.
|
||||
*/
|
||||
readonly fqbn: string;
|
||||
readonly programmer: string;
|
||||
readonly programmer?: string;
|
||||
}
|
||||
|
||||
export interface BoardSearch extends Searchable.Options {
|
||||
@@ -364,40 +368,6 @@ export interface ConfigOption {
|
||||
readonly values: ConfigValue[];
|
||||
}
|
||||
export namespace ConfigOption {
|
||||
/**
|
||||
* Appends the configuration options to the `fqbn` argument.
|
||||
* Throws an error if the `fqbn` does not have the `segment(':'segment)*` format.
|
||||
* The provided output format is always segment(':'segment)*(':'option'='value(','option'='value)*)?
|
||||
*/
|
||||
export function decorate(
|
||||
fqbn: string,
|
||||
configOptions: ConfigOption[]
|
||||
): string {
|
||||
if (!configOptions.length) {
|
||||
return fqbn;
|
||||
}
|
||||
|
||||
const toValue = (values: ConfigValue[]) => {
|
||||
const selectedValue = values.find(({ selected }) => selected);
|
||||
if (!selectedValue) {
|
||||
console.warn(
|
||||
`None of the config values was selected. Values were: ${JSON.stringify(
|
||||
values
|
||||
)}`
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
return selectedValue.value;
|
||||
};
|
||||
const options = configOptions
|
||||
.map(({ option, values }) => [option, toValue(values)])
|
||||
.filter(([, value]) => !!value)
|
||||
.map(([option, value]) => `${option}=${value}`)
|
||||
.join(',');
|
||||
|
||||
return `${fqbn}:${options}`;
|
||||
}
|
||||
|
||||
export class ConfigOptionError extends Error {
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
@@ -571,28 +541,13 @@ export namespace Board {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error if the `fqbn` argument is not sanitized. A sanitized FQBN has the `VENDOR:ARCHITECTURE:BOARD_ID` construct.
|
||||
*/
|
||||
export function assertSanitizedFqbn(fqbn: string): void {
|
||||
if (fqbn.split(':').length !== 3) {
|
||||
throw new Error(
|
||||
`Expected a sanitized FQBN with three segments in the following format: 'VENDOR:ARCHITECTURE:BOARD_ID'. Got ${fqbn} instead.`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the `VENDOR:ARCHITECTURE:BOARD_ID[:MENU_ID=OPTION_ID[,MENU2_ID=OPTION_ID ...]]` FQBN to
|
||||
* `VENDOR:ARCHITECTURE:BOARD_ID` format.
|
||||
* See the details of the `{build.fqbn}` entry in the [specs](https://arduino.github.io/arduino-cli/latest/platform-specification/#global-predefined-properties).
|
||||
*/
|
||||
export function sanitizeFqbn(fqbn: string | undefined): string | undefined {
|
||||
if (!fqbn) {
|
||||
return undefined;
|
||||
}
|
||||
const [vendor, arch, id] = fqbn.split(':');
|
||||
return `${vendor}:${arch}:${id}`;
|
||||
export function sanitizeFqbn(fqbn: string): string {
|
||||
return new FQBN(fqbn).sanitize().toString();
|
||||
}
|
||||
|
||||
export type PlatformIdentifier = Readonly<{ vendorId: string; arch: string }>;
|
||||
@@ -749,8 +704,8 @@ export function boardIdentifierEquals(
|
||||
return false; // TODO: This a strict now. Maybe compare name in the future.
|
||||
}
|
||||
if (left.fqbn && right.fqbn) {
|
||||
const leftFqbn = options.looseFqbn ? sanitizeFqbn(left.fqbn) : left.fqbn;
|
||||
const rightFqbn = options.looseFqbn ? sanitizeFqbn(right.fqbn) : right.fqbn;
|
||||
const leftFqbn = new FQBN(left.fqbn).toString(options.looseFqbn);
|
||||
const rightFqbn = new FQBN(right.fqbn).toString(options.looseFqbn);
|
||||
return leftFqbn === rightFqbn;
|
||||
}
|
||||
// No more Genuino hack.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ApplicationError } from '@theia/core/lib/common/application-error';
|
||||
import type { CancellationToken } from '@theia/core/lib/common/cancellation';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import type {
|
||||
Location,
|
||||
@@ -7,7 +8,7 @@ import type {
|
||||
} from '@theia/core/shared/vscode-languageserver-protocol';
|
||||
import type { CompileSummary as ApiCompileSummary } from 'vscode-arduino-api';
|
||||
import type { BoardUserField, Installable } from '../../common/protocol/';
|
||||
import { isPortIdentifier, PortIdentifier, Programmer } from './boards-service';
|
||||
import { PortIdentifier, Programmer, isPortIdentifier } from './boards-service';
|
||||
import type { IndexUpdateSummary } from './notification-service';
|
||||
import type { Sketch } from './sketches-service';
|
||||
|
||||
@@ -162,9 +163,18 @@ export function isUploadResponse(arg: unknown): arg is UploadResponse {
|
||||
export const CoreServicePath = '/services/core-service';
|
||||
export const CoreService = Symbol('CoreService');
|
||||
export interface CoreService {
|
||||
compile(options: CoreService.Options.Compile): Promise<void>;
|
||||
upload(options: CoreService.Options.Upload): Promise<UploadResponse>;
|
||||
burnBootloader(options: CoreService.Options.Bootloader): Promise<void>;
|
||||
compile(
|
||||
options: CoreService.Options.Compile,
|
||||
cancellationToken?: CancellationToken
|
||||
): Promise<void>;
|
||||
upload(
|
||||
options: CoreService.Options.Upload,
|
||||
cancellationToken?: CancellationToken
|
||||
): Promise<UploadResponse>;
|
||||
burnBootloader(
|
||||
options: CoreService.Options.Bootloader,
|
||||
cancellationToken?: CancellationToken
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Refreshes the underling core gRPC client for the Arduino CLI.
|
||||
*/
|
||||
|
||||
@@ -51,7 +51,7 @@ export interface NotificationServiceClient {
|
||||
notifyIndexUpdateDidFail(params: IndexUpdateDidFailParams): void;
|
||||
|
||||
// Daemon
|
||||
notifyDaemonDidStart(port: string): void;
|
||||
notifyDaemonDidStart(port: number): void;
|
||||
notifyDaemonDidStop(): void;
|
||||
|
||||
// CLI config
|
||||
|
||||
@@ -1,22 +1,48 @@
|
||||
import { ApplicationError } from '@theia/core/lib/common/application-error';
|
||||
import type { CancellationToken } from '@theia/core/lib/common/cancellation';
|
||||
import { CancellationTokenSource } from '@theia/core/lib/common/cancellation';
|
||||
import type { MessageService } from '@theia/core/lib/common/message-service';
|
||||
import type { Progress } from '@theia/core/lib/common/message-service-protocol';
|
||||
import { userAbort } from '../nls';
|
||||
import type { ResponseServiceClient } from './response-service';
|
||||
|
||||
export const UserAbortApplicationError = ApplicationError.declare(
|
||||
9999,
|
||||
(message: string, uri: string) => {
|
||||
return {
|
||||
message,
|
||||
data: { uri },
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
export class UserAbortError extends Error {
|
||||
constructor() {
|
||||
super(userAbort);
|
||||
Object.setPrototypeOf(this, UserAbortError.prototype);
|
||||
}
|
||||
}
|
||||
|
||||
export namespace ExecuteWithProgress {
|
||||
export async function doWithProgress<T>(options: {
|
||||
run: ({ progressId }: { progressId: string }) => Promise<T>;
|
||||
run: ({
|
||||
progressId,
|
||||
cancellationToken,
|
||||
}: {
|
||||
progressId: string;
|
||||
cancellationToken?: CancellationToken;
|
||||
}) => Promise<T>;
|
||||
messageService: MessageService;
|
||||
responseService: ResponseServiceClient;
|
||||
progressText: string;
|
||||
keepOutput?: boolean;
|
||||
cancelable?: boolean;
|
||||
}): Promise<T> {
|
||||
return withProgress(
|
||||
options.progressText,
|
||||
options.messageService,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async (progress, _token) => {
|
||||
async (progress, token) => {
|
||||
const progressId = progress.id;
|
||||
const toDispose = options.responseService.onProgressDidChange(
|
||||
(progressMessage) => {
|
||||
@@ -30,24 +56,29 @@ export namespace ExecuteWithProgress {
|
||||
if (!options.keepOutput) {
|
||||
options.responseService.clearOutput();
|
||||
}
|
||||
const result = await options.run({ progressId });
|
||||
const result = await options.run({
|
||||
progressId,
|
||||
cancellationToken: token,
|
||||
});
|
||||
return result;
|
||||
} finally {
|
||||
toDispose.dispose();
|
||||
}
|
||||
}
|
||||
},
|
||||
options.cancelable
|
||||
);
|
||||
}
|
||||
|
||||
export async function withProgress<T>(
|
||||
text: string,
|
||||
messageService: MessageService,
|
||||
cb: (progress: Progress, token: CancellationToken) => Promise<T>
|
||||
cb: (progress: Progress, token: CancellationToken) => Promise<T>,
|
||||
cancelable = false
|
||||
): Promise<T> {
|
||||
const cancellationSource = new CancellationTokenSource();
|
||||
const { token } = cancellationSource;
|
||||
const progress = await messageService.showProgress(
|
||||
{ text, options: { cancelable: false } },
|
||||
{ text, options: { cancelable } },
|
||||
() => cancellationSource.cancel()
|
||||
);
|
||||
try {
|
||||
|
||||
@@ -8,6 +8,8 @@ export namespace SketchesError {
|
||||
export const Codes = {
|
||||
NotFound: 5001,
|
||||
InvalidName: 5002,
|
||||
InvalidFolderName: 5003,
|
||||
SketchAlreadyContainsThisFile: 5004,
|
||||
};
|
||||
export const NotFound = ApplicationError.declare(
|
||||
Codes.NotFound,
|
||||
@@ -27,6 +29,30 @@ export namespace SketchesError {
|
||||
};
|
||||
}
|
||||
);
|
||||
export const InvalidFolderName = ApplicationError.declare(
|
||||
Codes.InvalidFolderName,
|
||||
(message: string, invalidFolderName: string) => {
|
||||
return {
|
||||
message,
|
||||
data: { invalidFolderName },
|
||||
};
|
||||
}
|
||||
);
|
||||
// https://github.com/arduino/arduino-ide/issues/827
|
||||
export const SketchAlreadyContainsThisFile = ApplicationError.declare(
|
||||
Codes.SketchAlreadyContainsThisFile,
|
||||
(
|
||||
message: string,
|
||||
sourceSketchName: string,
|
||||
targetSketchName: string,
|
||||
existingSketchFilename: string
|
||||
) => {
|
||||
return {
|
||||
message,
|
||||
data: { sourceSketchName, targetSketchName, existingSketchFilename },
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export const SketchesServicePath = '/services/sketches-service';
|
||||
|
||||
@@ -16,8 +16,8 @@ import { Deferred } from '@theia/core/lib/common/promise-util';
|
||||
import { isObject, MaybePromise, Mutable } from '@theia/core/lib/common/types';
|
||||
import { ElectronSecurityToken } from '@theia/core/lib/electron-common/electron-token';
|
||||
import {
|
||||
ElectronMainApplication as TheiaElectronMainApplication,
|
||||
ElectronMainExecutionParams,
|
||||
ElectronMainApplication as TheiaElectronMainApplication,
|
||||
} from '@theia/core/lib/electron-main/electron-main-application';
|
||||
import type { TheiaBrowserWindowOptions } from '@theia/core/lib/electron-main/theia-electron-window';
|
||||
import { FileUri } from '@theia/core/lib/node/file-uri';
|
||||
@@ -25,7 +25,7 @@ import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import { URI } from '@theia/core/shared/vscode-uri';
|
||||
import { log as logToFile, setup as setupFileLog } from 'node-log-rotate';
|
||||
import { fork } from 'node:child_process';
|
||||
import { promises as fs, rm, rmSync } from 'node:fs';
|
||||
import { promises as fs, readFileSync, rm, rmSync } from 'node:fs';
|
||||
import type { AddressInfo } from 'node:net';
|
||||
import { isAbsolute, join, resolve } from 'node:path';
|
||||
import { Sketch } from '../../common/protocol';
|
||||
@@ -745,6 +745,19 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback app config when starting IDE2 from an ino file (from Explorer, Finder, etc.) and the app config is not yet set.
|
||||
// https://github.com/arduino/arduino-ide/issues/2209
|
||||
private _fallbackConfig: FrontendApplicationConfig | undefined;
|
||||
override get config(): FrontendApplicationConfig {
|
||||
if (!this._config) {
|
||||
if (!this._fallbackConfig) {
|
||||
this._fallbackConfig = readFrontendAppConfigSync();
|
||||
}
|
||||
return this._fallbackConfig;
|
||||
}
|
||||
return super.config;
|
||||
}
|
||||
}
|
||||
|
||||
class InterruptWorkspaceRestoreError extends Error {
|
||||
@@ -775,11 +788,8 @@ async function updateFrontendApplicationConfigFromPackageJson(
|
||||
return config;
|
||||
}
|
||||
try {
|
||||
const modulePath = __filename;
|
||||
// must go from `./lib/backend/electron-main.js` to `./package.json` when the app is webpacked.
|
||||
const packageJsonPath = join(modulePath, '..', '..', '..', 'package.json');
|
||||
console.debug(
|
||||
`Checking for frontend application configuration customizations. Module path: ${modulePath}, destination 'package.json': ${packageJsonPath}`
|
||||
`Checking for frontend application configuration customizations. Module path: ${__filename}, destination 'package.json': ${packageJsonPath}`
|
||||
);
|
||||
const rawPackageJson = await fs.readFile(packageJsonPath, {
|
||||
encoding: 'utf8',
|
||||
@@ -827,6 +837,46 @@ async function updateFrontendApplicationConfigFromPackageJson(
|
||||
return config;
|
||||
}
|
||||
|
||||
const fallbackFrontendAppConfig: FrontendApplicationConfig = {
|
||||
applicationName: 'Arduino IDE',
|
||||
defaultTheme: {
|
||||
light: 'arduino-theme',
|
||||
dark: 'arduino-theme-dark',
|
||||
},
|
||||
defaultIconTheme: 'none',
|
||||
validatePreferencesSchema: false,
|
||||
defaultLocale: '',
|
||||
electron: {},
|
||||
};
|
||||
|
||||
// When the package.json must go from `./lib/backend/electron-main.js` to `./package.json` when the app is webpacked.
|
||||
// Only for production mode!
|
||||
const packageJsonPath = join(__filename, '..', '..', '..', 'package.json');
|
||||
|
||||
function readFrontendAppConfigSync(): FrontendApplicationConfig {
|
||||
if (environment.electron.isDevMode()) {
|
||||
console.debug(
|
||||
'Running in dev mode. Using the fallback fronted application config.'
|
||||
);
|
||||
return fallbackFrontendAppConfig;
|
||||
}
|
||||
try {
|
||||
const raw = readFileSync(packageJsonPath, { encoding: 'utf8' });
|
||||
const packageJson = JSON.parse(raw);
|
||||
const config = packageJson?.theia?.frontend?.config;
|
||||
if (config) {
|
||||
return config;
|
||||
}
|
||||
throw new Error(`Frontend application config not found. ${packageJson}`);
|
||||
} catch (err) {
|
||||
console.error(
|
||||
`Could not read package.json content from ${packageJsonPath}.`,
|
||||
err
|
||||
);
|
||||
return fallbackFrontendAppConfig;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mutates the `toUpdate` argument and returns with it.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import { credentials, makeClientConstructor } from '@grpc/grpc-js';
|
||||
import * as commandsGrpcPb from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb';
|
||||
import { ArduinoCoreServiceClient } from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb';
|
||||
|
||||
export interface CreateClientOptions {
|
||||
/**
|
||||
* The port to the Arduino CLI daemon.
|
||||
*/
|
||||
readonly port: number;
|
||||
/**
|
||||
* Defaults to `'localhost'`.
|
||||
*/
|
||||
readonly host?: string;
|
||||
|
||||
/**
|
||||
* gRCP channel options. Defaults to `createDefaultChannelOptions` with `'0.0.0'` `appVersion`
|
||||
*/
|
||||
readonly channelOptions?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export function createDefaultChannelOptions(
|
||||
appVersion = '0.0.0'
|
||||
): Record<string, unknown> {
|
||||
return {
|
||||
'grpc.max_send_message_length': 512 * 1024 * 1024,
|
||||
'grpc.max_receive_message_length': 512 * 1024 * 1024,
|
||||
'grpc.primary_user_agent': `arduino-ide/${appVersion}`,
|
||||
};
|
||||
}
|
||||
|
||||
export function createArduinoCoreServiceClient(
|
||||
options: CreateClientOptions
|
||||
): ArduinoCoreServiceClient {
|
||||
const {
|
||||
port,
|
||||
host = 'localhost',
|
||||
channelOptions = createDefaultChannelOptions(),
|
||||
} = options;
|
||||
const address = `${host}:${port}`;
|
||||
// https://github.com/agreatfool/grpc_tools_node_protoc_ts/blob/master/doc/grpcjs_support.md#usage
|
||||
const ArduinoCoreServiceClient = makeClientConstructor(
|
||||
// @ts-expect-error: ignore
|
||||
commandsGrpcPb['cc.arduino.cli.commands.v1.ArduinoCoreService'],
|
||||
'ArduinoCoreServiceService'
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
) as any;
|
||||
const client = new ArduinoCoreServiceClient(
|
||||
address,
|
||||
credentials.createInsecure(),
|
||||
channelOptions
|
||||
) as ArduinoCoreServiceClient;
|
||||
return client;
|
||||
}
|
||||
@@ -39,11 +39,11 @@ export class ArduinoDaemonImpl
|
||||
private readonly processUtils: ProcessUtils;
|
||||
|
||||
private readonly toDispose = new DisposableCollection();
|
||||
private readonly onDaemonStartedEmitter = new Emitter<string>();
|
||||
private readonly onDaemonStartedEmitter = new Emitter<number>();
|
||||
private readonly onDaemonStoppedEmitter = new Emitter<void>();
|
||||
|
||||
private _running = false;
|
||||
private _port = new Deferred<string>();
|
||||
private _port = new Deferred<number>();
|
||||
|
||||
// Backend application lifecycle.
|
||||
|
||||
@@ -53,18 +53,18 @@ export class ArduinoDaemonImpl
|
||||
|
||||
// Daemon API
|
||||
|
||||
async getPort(): Promise<string> {
|
||||
async getPort(): Promise<number> {
|
||||
return this._port.promise;
|
||||
}
|
||||
|
||||
async tryGetPort(): Promise<string | undefined> {
|
||||
async tryGetPort(): Promise<number | undefined> {
|
||||
if (this._running) {
|
||||
return this._port.promise;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
async start(): Promise<string> {
|
||||
async start(): Promise<number> {
|
||||
try {
|
||||
this.toDispose.dispose(); // This will `kill` the previously started daemon process, if any.
|
||||
const cliPath = this.getExecPath();
|
||||
@@ -101,13 +101,13 @@ export class ArduinoDaemonImpl
|
||||
this.toDispose.dispose();
|
||||
}
|
||||
|
||||
async restart(): Promise<string> {
|
||||
async restart(): Promise<number> {
|
||||
return this.start();
|
||||
}
|
||||
|
||||
// Backend only daemon API
|
||||
|
||||
get onDaemonStarted(): Event<string> {
|
||||
get onDaemonStarted(): Event<number> {
|
||||
return this.onDaemonStartedEmitter.event;
|
||||
}
|
||||
|
||||
@@ -150,11 +150,11 @@ export class ArduinoDaemonImpl
|
||||
|
||||
protected async spawnDaemonProcess(): Promise<{
|
||||
daemon: ChildProcess;
|
||||
port: string;
|
||||
port: number;
|
||||
}> {
|
||||
const args = await this.getSpawnArgs();
|
||||
const cliPath = this.getExecPath();
|
||||
const ready = new Deferred<{ daemon: ChildProcess; port: string }>();
|
||||
const ready = new Deferred<{ daemon: ChildProcess; port: number }>();
|
||||
const options = {
|
||||
env: { ...deepClone(process.env), NO_COLOR: String(true) },
|
||||
};
|
||||
@@ -195,7 +195,13 @@ export class ArduinoDaemonImpl
|
||||
|
||||
if (port.length && address.length) {
|
||||
grpcServerIsReady = true;
|
||||
ready.resolve({ daemon, port });
|
||||
const portNumber = Number.parseInt(port, 10);
|
||||
if (Number.isNaN(portNumber)) {
|
||||
ready.reject(
|
||||
new Error(`Received a NaN port from the CLI: ${port}`)
|
||||
);
|
||||
}
|
||||
ready.resolve({ daemon, port: portNumber });
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -225,7 +231,7 @@ export class ArduinoDaemonImpl
|
||||
return ready.promise;
|
||||
}
|
||||
|
||||
private fireDaemonStarted(port: string): void {
|
||||
private fireDaemonStarted(port: number): void {
|
||||
this._running = true;
|
||||
this._port.resolve(port);
|
||||
this.onDaemonStartedEmitter.fire(port);
|
||||
@@ -238,7 +244,7 @@ export class ArduinoDaemonImpl
|
||||
}
|
||||
this._running = false;
|
||||
this._port.reject(); // Reject all pending.
|
||||
this._port = new Deferred<string>();
|
||||
this._port = new Deferred<number>();
|
||||
this.onDaemonStoppedEmitter.fire();
|
||||
this.notificationService.notifyDaemonDidStop();
|
||||
}
|
||||
|
||||
@@ -267,24 +267,12 @@ export class BoardDiscovery
|
||||
const { port, boards } = detectedPort;
|
||||
const key = Port.keyOf(port);
|
||||
if (eventType === EventType.Add) {
|
||||
const alreadyDetectedPort = newState[key];
|
||||
if (alreadyDetectedPort) {
|
||||
console.warn(
|
||||
`Detected a new port that has been already discovered. The old value will be overridden. Old value: ${JSON.stringify(
|
||||
alreadyDetectedPort
|
||||
)}, new value: ${JSON.stringify(detectedPort)}`
|
||||
);
|
||||
}
|
||||
// Note that, the serial discovery might detect port details (such as addressLabel) in chunks.
|
||||
// For example, first, the Teensy 4.1 port is detected with the `[no_device] Triple Serial` address label,
|
||||
// Then, when more refinements are available, the same port is detected with `/dev/cu.usbmodem127902301 Triple Serial` address label.
|
||||
// In such cases, an `add` event is received from the CLI, and the the detected port is overridden in the state.
|
||||
newState[key] = { port, boards };
|
||||
} else if (eventType === EventType.Remove) {
|
||||
const alreadyDetectedPort = newState[key];
|
||||
if (!alreadyDetectedPort) {
|
||||
console.warn(
|
||||
`Detected a port removal but it has not been discovered. This is most likely a bug! Detected port was: ${JSON.stringify(
|
||||
detectedPort
|
||||
)}`
|
||||
);
|
||||
}
|
||||
delete newState[key];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import { notEmpty } from '@theia/core/lib/common/objects';
|
||||
import { Mutable } from '@theia/core/lib/common/types';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import {
|
||||
Board,
|
||||
BoardDetails,
|
||||
BoardSearch,
|
||||
BoardUserField,
|
||||
@@ -32,11 +32,9 @@ import {
|
||||
BoardListAllResponse,
|
||||
BoardSearchRequest,
|
||||
} from './cli-protocol/cc/arduino/cli/commands/v1/board_pb';
|
||||
import { Platform } from './cli-protocol/cc/arduino/cli/commands/v1/common_pb';
|
||||
import { PlatformSummary } from './cli-protocol/cc/arduino/cli/commands/v1/common_pb';
|
||||
import {
|
||||
PlatformInstallRequest,
|
||||
PlatformListRequest,
|
||||
PlatformListResponse,
|
||||
PlatformSearchRequest,
|
||||
PlatformSearchResponse,
|
||||
PlatformUninstallRequest,
|
||||
@@ -178,7 +176,7 @@ export class BoardsServiceImpl
|
||||
const req = new IsDebugSupportedRequest()
|
||||
.setInstance(instance)
|
||||
.setFqbn(fqbn)
|
||||
.setProgrammer(programmer);
|
||||
.setProgrammer(programmer ?? '');
|
||||
try {
|
||||
const debugFqbn = await new Promise<string>((resolve, reject) =>
|
||||
client.isDebugSupported(req, (err, resp) => {
|
||||
@@ -247,24 +245,22 @@ export class BoardsServiceImpl
|
||||
|
||||
async getInstalledPlatforms(): Promise<BoardsPackage[]> {
|
||||
const { instance, client } = await this.coreClient;
|
||||
return new Promise<BoardsPackage[]>((resolve, reject) => {
|
||||
client.platformList(
|
||||
new PlatformListRequest().setInstance(instance),
|
||||
(err, response) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
resolve(
|
||||
response
|
||||
.getInstalledPlatformsList()
|
||||
.map((platform, _, installedPlatforms) =>
|
||||
toBoardsPackage(platform, installedPlatforms)
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
const resp = await new Promise<PlatformSearchResponse>(
|
||||
(resolve, reject) => {
|
||||
client.platformSearch(
|
||||
new PlatformSearchRequest()
|
||||
.setInstance(instance)
|
||||
.setManuallyInstalled(true), // include core manually installed to the sketchbook
|
||||
(err, resp) => (err ? reject(err) : resolve(resp))
|
||||
);
|
||||
}
|
||||
);
|
||||
const searchOutput = resp.getSearchOutputList();
|
||||
return searchOutput
|
||||
.map((message) => message.toObject(false))
|
||||
.filter((summary) => summary.installedVersion) // only installed ones
|
||||
.map(createBoardsPackage)
|
||||
.filter(notEmpty);
|
||||
}
|
||||
|
||||
private async handleListBoards(
|
||||
@@ -287,12 +283,28 @@ export class BoardsServiceImpl
|
||||
for (const board of resp.getBoardsList()) {
|
||||
const platform = board.getPlatform();
|
||||
if (platform) {
|
||||
const platformId = platform.getId();
|
||||
const metadata = platform.getMetadata();
|
||||
if (!metadata) {
|
||||
console.warn(
|
||||
`Platform metadata is missing for platform: ${JSON.stringify(
|
||||
platform.toObject(false)
|
||||
)}. Skipping`
|
||||
);
|
||||
continue;
|
||||
}
|
||||
const platformId = metadata.getId();
|
||||
const release = platform.getRelease();
|
||||
if (!release) {
|
||||
console.warn(
|
||||
`Platform release is missing for platform: ${platformId}. Skipping`
|
||||
);
|
||||
continue;
|
||||
}
|
||||
const fqbn = board.getFqbn() || undefined; // prefer undefined over empty string
|
||||
const parsedPlatformId = createPlatformIdentifier(platformId);
|
||||
if (!parsedPlatformId) {
|
||||
console.warn(
|
||||
`Could not create platform identifier from platform ID input: ${platform.getId()}. Skipping`
|
||||
`Could not create platform identifier from platform ID input: ${platformId}. Skipping`
|
||||
);
|
||||
continue;
|
||||
}
|
||||
@@ -319,8 +331,8 @@ export class BoardsServiceImpl
|
||||
name: board.getName(),
|
||||
fqbn: board.getFqbn(),
|
||||
packageId: parsedPlatformId,
|
||||
packageName: platform.getName(),
|
||||
manuallyInstalled: platform.getManuallyInstalled(),
|
||||
packageName: release.getName(),
|
||||
manuallyInstalled: metadata.getManuallyInstalled(),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -375,89 +387,25 @@ export class BoardsServiceImpl
|
||||
const coreClient = await this.coreClient;
|
||||
const { client, instance } = coreClient;
|
||||
|
||||
const installedPlatformsReq = new PlatformListRequest();
|
||||
installedPlatformsReq.setInstance(instance);
|
||||
const installedPlatformsResp = await new Promise<PlatformListResponse>(
|
||||
(resolve, reject) => {
|
||||
client.platformList(installedPlatformsReq, (err, resp) => {
|
||||
!!err ? reject(err) : resolve(resp);
|
||||
});
|
||||
}
|
||||
);
|
||||
const installedPlatforms =
|
||||
installedPlatformsResp.getInstalledPlatformsList();
|
||||
|
||||
const req = new PlatformSearchRequest();
|
||||
req.setSearchArgs(options.query || '');
|
||||
req.setAllVersions(true);
|
||||
req.setInstance(instance);
|
||||
// `core search` returns with all platform versions when the command is executed via gRPC or with `--format json`
|
||||
// The `--all` flag is applicable only when filtering for the human-readable (`--format text`) output of the CLI
|
||||
const resp = await new Promise<PlatformSearchResponse>(
|
||||
(resolve, reject) => {
|
||||
client.platformSearch(req, (err, resp) => {
|
||||
!!err ? reject(err) : resolve(resp);
|
||||
});
|
||||
client.platformSearch(
|
||||
new PlatformSearchRequest()
|
||||
.setInstance(instance)
|
||||
.setSearchArgs(options.query ?? ''),
|
||||
(err, resp) => (err ? reject(err) : resolve(resp))
|
||||
);
|
||||
}
|
||||
);
|
||||
const packages = new Map<string, BoardsPackage>();
|
||||
// We must group the cores by ID, and sort platforms by, first the installed version, then version alphabetical order.
|
||||
// Otherwise we lose the FQBN information.
|
||||
const groupedById: Map<string, Platform[]> = new Map();
|
||||
for (const platform of resp.getSearchOutputList()) {
|
||||
const id = platform.getId();
|
||||
const idGroup = groupedById.get(id);
|
||||
if (idGroup) {
|
||||
idGroup.push(platform);
|
||||
} else {
|
||||
groupedById.set(id, [platform]);
|
||||
}
|
||||
}
|
||||
const installedAwareVersionComparator = (
|
||||
left: Platform,
|
||||
right: Platform
|
||||
) => {
|
||||
// XXX: we cannot rely on `platform.getInstalled()`, it is always an empty string.
|
||||
const leftInstalled = !!installedPlatforms.find(
|
||||
(ip) =>
|
||||
ip.getId() === left.getId() && ip.getInstalled() === left.getLatest()
|
||||
);
|
||||
const rightInstalled = !!installedPlatforms.find(
|
||||
(ip) =>
|
||||
ip.getId() === right.getId() &&
|
||||
ip.getInstalled() === right.getLatest()
|
||||
);
|
||||
if (leftInstalled && !rightInstalled) {
|
||||
return -1;
|
||||
}
|
||||
if (!leftInstalled && rightInstalled) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const invertedVersionComparator =
|
||||
Installable.Version.COMPARATOR(left.getLatest(), right.getLatest()) *
|
||||
-1;
|
||||
// Higher version comes first.
|
||||
|
||||
return invertedVersionComparator;
|
||||
};
|
||||
for (const value of groupedById.values()) {
|
||||
value.sort(installedAwareVersionComparator);
|
||||
}
|
||||
|
||||
for (const value of groupedById.values()) {
|
||||
for (const platform of value) {
|
||||
const id = platform.getId();
|
||||
const pkg = packages.get(id);
|
||||
if (pkg) {
|
||||
pkg.availableVersions.push(platform.getLatest());
|
||||
pkg.availableVersions.sort(Installable.Version.COMPARATOR).reverse();
|
||||
} else {
|
||||
packages.set(id, toBoardsPackage(platform, installedPlatforms));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const filter = this.typePredicate(options);
|
||||
const boardsPackages = [...packages.values()].filter(filter);
|
||||
const typeFilter = this.typePredicate(options);
|
||||
const searchOutput = resp.getSearchOutputList();
|
||||
const boardsPackages = searchOutput
|
||||
.map((message) => message.toObject(false))
|
||||
.map(createBoardsPackage)
|
||||
.filter(notEmpty)
|
||||
.filter(typeFilter);
|
||||
return sortComponents(boardsPackages, boardsPackageSortGroup);
|
||||
}
|
||||
|
||||
@@ -624,36 +572,52 @@ function boardsPackageSortGroup(boardsPackage: BoardsPackage): SortGroup {
|
||||
return types.join('-') as SortGroup;
|
||||
}
|
||||
|
||||
function toBoardsPackage(
|
||||
platform: Platform,
|
||||
installedPlatforms: Platform[]
|
||||
): BoardsPackage {
|
||||
let installedVersion: string | undefined;
|
||||
const matchingPlatform = installedPlatforms.find(
|
||||
(ip) => ip.getId() === platform.getId()
|
||||
);
|
||||
if (!!matchingPlatform) {
|
||||
installedVersion = matchingPlatform.getInstalled();
|
||||
function createBoardsPackage(
|
||||
summary: PlatformSummary.AsObject
|
||||
): BoardsPackage | undefined {
|
||||
if (!isPlatformSummaryWithMetadata(summary)) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
id: platform.getId(),
|
||||
name: platform.getName(),
|
||||
author: platform.getMaintainer(),
|
||||
availableVersions: [platform.getLatest()],
|
||||
description: platform
|
||||
.getBoardsList()
|
||||
.map((b) => b.getName())
|
||||
.join(', '),
|
||||
types: platform.getTypeList(),
|
||||
deprecated: platform.getDeprecated(),
|
||||
const versionReleaseMap = new Map(summary.releasesMap);
|
||||
const actualRelease =
|
||||
versionReleaseMap.get(summary.installedVersion) ??
|
||||
versionReleaseMap.get(summary.latestVersion);
|
||||
if (!actualRelease) {
|
||||
return undefined;
|
||||
}
|
||||
const { name, typeList, boardsList, deprecated, compatible } = actualRelease;
|
||||
if (!compatible) {
|
||||
return undefined; // never show incompatible platforms
|
||||
}
|
||||
const { id, website, maintainer } = summary.metadata;
|
||||
const availableVersions = Array.from(versionReleaseMap.keys())
|
||||
.sort(Installable.Version.COMPARATOR)
|
||||
.reverse();
|
||||
const boardsPackage: Mutable<BoardsPackage> = {
|
||||
id,
|
||||
name,
|
||||
summary: nls.localize(
|
||||
'arduino/component/boardsIncluded',
|
||||
'Boards included in this package:'
|
||||
),
|
||||
installedVersion,
|
||||
boards: platform
|
||||
.getBoardsList()
|
||||
.map((b) => <Board>{ name: b.getName(), fqbn: b.getFqbn() }),
|
||||
moreInfoLink: platform.getWebsite(),
|
||||
description: boardsList.map(({ name }) => name).join(', '),
|
||||
boards: boardsList,
|
||||
types: typeList,
|
||||
moreInfoLink: website,
|
||||
author: maintainer,
|
||||
deprecated,
|
||||
availableVersions,
|
||||
};
|
||||
if (summary.installedVersion) {
|
||||
boardsPackage.installedVersion = summary.installedVersion;
|
||||
}
|
||||
return boardsPackage;
|
||||
}
|
||||
|
||||
type PlatformSummaryWithMetadata = PlatformSummary.AsObject &
|
||||
Required<Pick<PlatformSummary.AsObject, 'metadata'>>;
|
||||
function isPlatformSummaryWithMetadata(
|
||||
summary: PlatformSummary.AsObject
|
||||
): summary is PlatformSummaryWithMetadata {
|
||||
return Boolean(summary.metadata);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import * as cc_arduino_cli_commands_v1_debug_pb from "../../../../../cc/arduino/
|
||||
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";
|
||||
import * as cc_arduino_cli_commands_v1_settings_pb from "../../../../../cc/arduino/cli/commands/v1/settings_pb";
|
||||
|
||||
interface IArduinoCoreServiceService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
|
||||
create: IArduinoCoreServiceService_ICreate;
|
||||
@@ -43,7 +44,6 @@ interface IArduinoCoreServiceService extends grpc.ServiceDefinition<grpc.Untyped
|
||||
listProgrammersAvailableForUpload: IArduinoCoreServiceService_IListProgrammersAvailableForUpload;
|
||||
burnBootloader: IArduinoCoreServiceService_IBurnBootloader;
|
||||
platformSearch: IArduinoCoreServiceService_IPlatformSearch;
|
||||
platformList: IArduinoCoreServiceService_IPlatformList;
|
||||
libraryDownload: IArduinoCoreServiceService_ILibraryDownload;
|
||||
libraryInstall: IArduinoCoreServiceService_ILibraryInstall;
|
||||
libraryUpgrade: IArduinoCoreServiceService_ILibraryUpgrade;
|
||||
@@ -59,6 +59,12 @@ interface IArduinoCoreServiceService extends grpc.ServiceDefinition<grpc.Untyped
|
||||
debug: IArduinoCoreServiceService_IDebug;
|
||||
isDebugSupported: IArduinoCoreServiceService_IIsDebugSupported;
|
||||
getDebugConfig: IArduinoCoreServiceService_IGetDebugConfig;
|
||||
settingsGetAll: IArduinoCoreServiceService_ISettingsGetAll;
|
||||
settingsMerge: IArduinoCoreServiceService_ISettingsMerge;
|
||||
settingsGetValue: IArduinoCoreServiceService_ISettingsGetValue;
|
||||
settingsSetValue: IArduinoCoreServiceService_ISettingsSetValue;
|
||||
settingsWrite: IArduinoCoreServiceService_ISettingsWrite;
|
||||
settingsDelete: IArduinoCoreServiceService_ISettingsDelete;
|
||||
}
|
||||
|
||||
interface IArduinoCoreServiceService_ICreate extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_commands_pb.CreateRequest, cc_arduino_cli_commands_v1_commands_pb.CreateResponse> {
|
||||
@@ -295,15 +301,6 @@ interface IArduinoCoreServiceService_IPlatformSearch extends grpc.MethodDefiniti
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_core_pb.PlatformSearchResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_core_pb.PlatformSearchResponse>;
|
||||
}
|
||||
interface IArduinoCoreServiceService_IPlatformList extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_core_pb.PlatformListRequest, cc_arduino_cli_commands_v1_core_pb.PlatformListResponse> {
|
||||
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/PlatformList";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_commands_v1_core_pb.PlatformListRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_core_pb.PlatformListRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_core_pb.PlatformListResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_core_pb.PlatformListResponse>;
|
||||
}
|
||||
interface IArduinoCoreServiceService_ILibraryDownload extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadRequest, cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadResponse> {
|
||||
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/LibraryDownload";
|
||||
requestStream: false;
|
||||
@@ -439,6 +436,60 @@ interface IArduinoCoreServiceService_IGetDebugConfig extends grpc.MethodDefiniti
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse>;
|
||||
}
|
||||
interface IArduinoCoreServiceService_ISettingsGetAll extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse> {
|
||||
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsGetAll";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse>;
|
||||
}
|
||||
interface IArduinoCoreServiceService_ISettingsMerge extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse> {
|
||||
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsMerge";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse>;
|
||||
}
|
||||
interface IArduinoCoreServiceService_ISettingsGetValue extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse> {
|
||||
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsGetValue";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse>;
|
||||
}
|
||||
interface IArduinoCoreServiceService_ISettingsSetValue extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse> {
|
||||
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsSetValue";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse>;
|
||||
}
|
||||
interface IArduinoCoreServiceService_ISettingsWrite extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse> {
|
||||
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsWrite";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse>;
|
||||
}
|
||||
interface IArduinoCoreServiceService_ISettingsDelete extends grpc.MethodDefinition<cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse> {
|
||||
path: "/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsDelete";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse>;
|
||||
}
|
||||
|
||||
export const ArduinoCoreServiceService: IArduinoCoreServiceService;
|
||||
|
||||
@@ -469,7 +520,6 @@ export interface IArduinoCoreServiceServer extends grpc.UntypedServiceImplementa
|
||||
listProgrammersAvailableForUpload: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_upload_pb.ListProgrammersAvailableForUploadRequest, cc_arduino_cli_commands_v1_upload_pb.ListProgrammersAvailableForUploadResponse>;
|
||||
burnBootloader: grpc.handleServerStreamingCall<cc_arduino_cli_commands_v1_upload_pb.BurnBootloaderRequest, cc_arduino_cli_commands_v1_upload_pb.BurnBootloaderResponse>;
|
||||
platformSearch: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_core_pb.PlatformSearchRequest, cc_arduino_cli_commands_v1_core_pb.PlatformSearchResponse>;
|
||||
platformList: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_core_pb.PlatformListRequest, cc_arduino_cli_commands_v1_core_pb.PlatformListResponse>;
|
||||
libraryDownload: grpc.handleServerStreamingCall<cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadRequest, cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadResponse>;
|
||||
libraryInstall: grpc.handleServerStreamingCall<cc_arduino_cli_commands_v1_lib_pb.LibraryInstallRequest, cc_arduino_cli_commands_v1_lib_pb.LibraryInstallResponse>;
|
||||
libraryUpgrade: grpc.handleServerStreamingCall<cc_arduino_cli_commands_v1_lib_pb.LibraryUpgradeRequest, cc_arduino_cli_commands_v1_lib_pb.LibraryUpgradeResponse>;
|
||||
@@ -485,6 +535,12 @@ export interface IArduinoCoreServiceServer extends grpc.UntypedServiceImplementa
|
||||
debug: grpc.handleBidiStreamingCall<cc_arduino_cli_commands_v1_debug_pb.DebugRequest, cc_arduino_cli_commands_v1_debug_pb.DebugResponse>;
|
||||
isDebugSupported: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_debug_pb.IsDebugSupportedRequest, cc_arduino_cli_commands_v1_debug_pb.IsDebugSupportedResponse>;
|
||||
getDebugConfig: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigRequest, cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse>;
|
||||
settingsGetAll: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse>;
|
||||
settingsMerge: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse>;
|
||||
settingsGetValue: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse>;
|
||||
settingsSetValue: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse>;
|
||||
settingsWrite: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse>;
|
||||
settingsDelete: grpc.handleUnaryCall<cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest, cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse>;
|
||||
}
|
||||
|
||||
export interface IArduinoCoreServiceClient {
|
||||
@@ -554,9 +610,6 @@ export interface IArduinoCoreServiceClient {
|
||||
platformSearch(request: cc_arduino_cli_commands_v1_core_pb.PlatformSearchRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformSearchResponse) => void): grpc.ClientUnaryCall;
|
||||
platformSearch(request: cc_arduino_cli_commands_v1_core_pb.PlatformSearchRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformSearchResponse) => void): grpc.ClientUnaryCall;
|
||||
platformSearch(request: cc_arduino_cli_commands_v1_core_pb.PlatformSearchRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformSearchResponse) => void): grpc.ClientUnaryCall;
|
||||
platformList(request: cc_arduino_cli_commands_v1_core_pb.PlatformListRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformListResponse) => void): grpc.ClientUnaryCall;
|
||||
platformList(request: cc_arduino_cli_commands_v1_core_pb.PlatformListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformListResponse) => void): grpc.ClientUnaryCall;
|
||||
platformList(request: cc_arduino_cli_commands_v1_core_pb.PlatformListRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformListResponse) => void): grpc.ClientUnaryCall;
|
||||
libraryDownload(request: cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadResponse>;
|
||||
libraryDownload(request: cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadRequest, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadResponse>;
|
||||
libraryInstall(request: cc_arduino_cli_commands_v1_lib_pb.LibraryInstallRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_lib_pb.LibraryInstallResponse>;
|
||||
@@ -595,6 +648,24 @@ export interface IArduinoCoreServiceClient {
|
||||
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<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsGetAll(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsGetAll(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsGetAll(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsMerge(request: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsMerge(request: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsMerge(request: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsGetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsGetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsGetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsSetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsSetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsSetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsWrite(request: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsWrite(request: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsWrite(request: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsDelete(request: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsDelete(request: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
settingsDelete(request: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
}
|
||||
|
||||
export class ArduinoCoreServiceClient extends grpc.Client implements IArduinoCoreServiceClient {
|
||||
@@ -665,9 +736,6 @@ export class ArduinoCoreServiceClient extends grpc.Client implements IArduinoCor
|
||||
public platformSearch(request: cc_arduino_cli_commands_v1_core_pb.PlatformSearchRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformSearchResponse) => void): grpc.ClientUnaryCall;
|
||||
public platformSearch(request: cc_arduino_cli_commands_v1_core_pb.PlatformSearchRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformSearchResponse) => void): grpc.ClientUnaryCall;
|
||||
public platformSearch(request: cc_arduino_cli_commands_v1_core_pb.PlatformSearchRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformSearchResponse) => void): grpc.ClientUnaryCall;
|
||||
public platformList(request: cc_arduino_cli_commands_v1_core_pb.PlatformListRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformListResponse) => void): grpc.ClientUnaryCall;
|
||||
public platformList(request: cc_arduino_cli_commands_v1_core_pb.PlatformListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformListResponse) => void): grpc.ClientUnaryCall;
|
||||
public platformList(request: cc_arduino_cli_commands_v1_core_pb.PlatformListRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_core_pb.PlatformListResponse) => void): grpc.ClientUnaryCall;
|
||||
public libraryDownload(request: cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadResponse>;
|
||||
public libraryDownload(request: cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadRequest, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_lib_pb.LibraryDownloadResponse>;
|
||||
public libraryInstall(request: cc_arduino_cli_commands_v1_lib_pb.LibraryInstallRequest, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<cc_arduino_cli_commands_v1_lib_pb.LibraryInstallResponse>;
|
||||
@@ -704,4 +772,22 @@ export class ArduinoCoreServiceClient extends grpc.Client implements IArduinoCor
|
||||
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<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_debug_pb.GetDebugConfigResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsGetAll(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsGetAll(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsGetAll(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsMerge(request: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsMerge(request: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsMerge(request: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsGetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsGetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsGetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsSetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsSetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsSetValue(request: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsWrite(request: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsWrite(request: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsWrite(request: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsDelete(request: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsDelete(request: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
public settingsDelete(request: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ var cc_arduino_cli_commands_v1_debug_pb = require('../../../../../cc/arduino/cli
|
||||
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');
|
||||
var cc_arduino_cli_commands_v1_settings_pb = require('../../../../../cc/arduino/cli/commands/v1/settings_pb.js');
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_ArchiveSketchRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchRequest)) {
|
||||
@@ -688,28 +689,6 @@ function deserialize_cc_arduino_cli_commands_v1_PlatformInstallResponse(buffer_a
|
||||
return cc_arduino_cli_commands_v1_core_pb.PlatformInstallResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_PlatformListRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_core_pb.PlatformListRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.PlatformListRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_PlatformListRequest(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_core_pb.PlatformListRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_PlatformListResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_core_pb.PlatformListResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.PlatformListResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_PlatformListResponse(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_core_pb.PlatformListResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_PlatformSearchRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_core_pb.PlatformSearchRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.PlatformSearchRequest');
|
||||
@@ -798,6 +777,138 @@ function deserialize_cc_arduino_cli_commands_v1_SetSketchDefaultsResponse(buffer
|
||||
return cc_arduino_cli_commands_v1_commands_pb.SetSketchDefaultsResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsDeleteRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsDeleteRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsDeleteRequest(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsDeleteResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsDeleteResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsDeleteResponse(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsGetAllRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsGetAllRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsGetAllRequest(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsGetAllResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsGetAllResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsGetAllResponse(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsGetValueRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsGetValueRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsGetValueRequest(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsGetValueResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsGetValueResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsGetValueResponse(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsMergeRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsMergeRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsMergeRequest(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsMergeResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsMergeResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsMergeResponse(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsSetValueRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsSetValueRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsSetValueRequest(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsSetValueResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsSetValueResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsSetValueResponse(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsWriteRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsWriteRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsWriteRequest(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SettingsWriteResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SettingsWriteResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_commands_v1_SettingsWriteResponse(buffer_arg) {
|
||||
return cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_commands_v1_SupportedUserFieldsRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_commands_v1_upload_pb.SupportedUserFieldsRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.commands.v1.SupportedUserFieldsRequest');
|
||||
@@ -1276,18 +1387,6 @@ platformSearch: {
|
||||
responseSerialize: serialize_cc_arduino_cli_commands_v1_PlatformSearchResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_PlatformSearchResponse,
|
||||
},
|
||||
// List all installed platforms.
|
||||
platformList: {
|
||||
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/PlatformList',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_commands_v1_core_pb.PlatformListRequest,
|
||||
responseType: cc_arduino_cli_commands_v1_core_pb.PlatformListResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_commands_v1_PlatformListRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_commands_v1_PlatformListRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_commands_v1_PlatformListResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_PlatformListResponse,
|
||||
},
|
||||
// Download the archive file of an Arduino library in the libraries index to
|
||||
// the staging directory.
|
||||
libraryDownload: {
|
||||
@@ -1470,5 +1569,77 @@ getDebugConfig: {
|
||||
responseSerialize: serialize_cc_arduino_cli_commands_v1_GetDebugConfigResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_GetDebugConfigResponse,
|
||||
},
|
||||
// List all the settings.
|
||||
settingsGetAll: {
|
||||
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsGetAll',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllRequest,
|
||||
responseType: cc_arduino_cli_commands_v1_settings_pb.SettingsGetAllResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_commands_v1_SettingsGetAllRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsGetAllRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_commands_v1_SettingsGetAllResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsGetAllResponse,
|
||||
},
|
||||
// Set multiple settings values at once.
|
||||
settingsMerge: {
|
||||
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsMerge',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeRequest,
|
||||
responseType: cc_arduino_cli_commands_v1_settings_pb.SettingsMergeResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_commands_v1_SettingsMergeRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsMergeRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_commands_v1_SettingsMergeResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsMergeResponse,
|
||||
},
|
||||
// Get the value of a specific setting.
|
||||
settingsGetValue: {
|
||||
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsGetValue',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueRequest,
|
||||
responseType: cc_arduino_cli_commands_v1_settings_pb.SettingsGetValueResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_commands_v1_SettingsGetValueRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsGetValueRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_commands_v1_SettingsGetValueResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsGetValueResponse,
|
||||
},
|
||||
// Set the value of a specific setting.
|
||||
settingsSetValue: {
|
||||
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsSetValue',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueRequest,
|
||||
responseType: cc_arduino_cli_commands_v1_settings_pb.SettingsSetValueResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_commands_v1_SettingsSetValueRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsSetValueRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_commands_v1_SettingsSetValueResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsSetValueResponse,
|
||||
},
|
||||
// Writes to file settings currently stored in memory
|
||||
settingsWrite: {
|
||||
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsWrite',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteRequest,
|
||||
responseType: cc_arduino_cli_commands_v1_settings_pb.SettingsWriteResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_commands_v1_SettingsWriteRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsWriteRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_commands_v1_SettingsWriteResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsWriteResponse,
|
||||
},
|
||||
// Deletes an entry and rewrites the file settings
|
||||
settingsDelete: {
|
||||
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsDelete',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteRequest,
|
||||
responseType: cc_arduino_cli_commands_v1_settings_pb.SettingsDeleteResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_commands_v1_SettingsDeleteRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsDeleteRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_commands_v1_SettingsDeleteResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsDeleteResponse,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import * as cc_arduino_cli_commands_v1_debug_pb from "../../../../../cc/arduino/
|
||||
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";
|
||||
import * as cc_arduino_cli_commands_v1_settings_pb from "../../../../../cc/arduino/cli/commands/v1/settings_pb";
|
||||
|
||||
export class CreateRequest extends jspb.Message {
|
||||
|
||||
@@ -421,61 +422,12 @@ export namespace LoadSketchRequest {
|
||||
}
|
||||
}
|
||||
|
||||
export class SketchProfile extends jspb.Message {
|
||||
getName(): string;
|
||||
setName(value: string): SketchProfile;
|
||||
getFqbn(): string;
|
||||
setFqbn(value: string): SketchProfile;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SketchProfile.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SketchProfile): SketchProfile.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SketchProfile, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SketchProfile;
|
||||
static deserializeBinaryFromReader(message: SketchProfile, reader: jspb.BinaryReader): SketchProfile;
|
||||
}
|
||||
|
||||
export namespace SketchProfile {
|
||||
export type AsObject = {
|
||||
name: string,
|
||||
fqbn: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class LoadSketchResponse extends jspb.Message {
|
||||
getMainFile(): string;
|
||||
setMainFile(value: string): LoadSketchResponse;
|
||||
getLocationPath(): string;
|
||||
setLocationPath(value: string): LoadSketchResponse;
|
||||
clearOtherSketchFilesList(): void;
|
||||
getOtherSketchFilesList(): Array<string>;
|
||||
setOtherSketchFilesList(value: Array<string>): LoadSketchResponse;
|
||||
addOtherSketchFiles(value: string, index?: number): string;
|
||||
clearAdditionalFilesList(): void;
|
||||
getAdditionalFilesList(): Array<string>;
|
||||
setAdditionalFilesList(value: Array<string>): LoadSketchResponse;
|
||||
addAdditionalFiles(value: string, index?: number): string;
|
||||
clearRootFolderFilesList(): void;
|
||||
getRootFolderFilesList(): Array<string>;
|
||||
setRootFolderFilesList(value: Array<string>): LoadSketchResponse;
|
||||
addRootFolderFiles(value: string, index?: number): string;
|
||||
getDefaultFqbn(): string;
|
||||
setDefaultFqbn(value: string): LoadSketchResponse;
|
||||
getDefaultPort(): string;
|
||||
setDefaultPort(value: string): LoadSketchResponse;
|
||||
getDefaultProtocol(): string;
|
||||
setDefaultProtocol(value: string): LoadSketchResponse;
|
||||
clearProfilesList(): void;
|
||||
getProfilesList(): Array<SketchProfile>;
|
||||
setProfilesList(value: Array<SketchProfile>): LoadSketchResponse;
|
||||
addProfiles(value?: SketchProfile, index?: number): SketchProfile;
|
||||
|
||||
hasDefaultProfile(): boolean;
|
||||
clearDefaultProfile(): void;
|
||||
getDefaultProfile(): SketchProfile | undefined;
|
||||
setDefaultProfile(value?: SketchProfile): LoadSketchResponse;
|
||||
hasSketch(): boolean;
|
||||
clearSketch(): void;
|
||||
getSketch(): cc_arduino_cli_commands_v1_common_pb.Sketch | undefined;
|
||||
setSketch(value?: cc_arduino_cli_commands_v1_common_pb.Sketch): LoadSketchResponse;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): LoadSketchResponse.AsObject;
|
||||
@@ -489,16 +441,7 @@ export class LoadSketchResponse extends jspb.Message {
|
||||
|
||||
export namespace LoadSketchResponse {
|
||||
export type AsObject = {
|
||||
mainFile: string,
|
||||
locationPath: string,
|
||||
otherSketchFilesList: Array<string>,
|
||||
additionalFilesList: Array<string>,
|
||||
rootFolderFilesList: Array<string>,
|
||||
defaultFqbn: string,
|
||||
defaultPort: string,
|
||||
defaultProtocol: string,
|
||||
profilesList: Array<SketchProfile.AsObject>,
|
||||
defaultProfile?: SketchProfile.AsObject,
|
||||
sketch?: cc_arduino_cli_commands_v1_common_pb.Sketch.AsObject,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,8 @@ var cc_arduino_cli_commands_v1_upload_pb = require('../../../../../cc/arduino/cl
|
||||
goog.object.extend(proto, cc_arduino_cli_commands_v1_upload_pb);
|
||||
var cc_arduino_cli_commands_v1_lib_pb = require('../../../../../cc/arduino/cli/commands/v1/lib_pb.js');
|
||||
goog.object.extend(proto, cc_arduino_cli_commands_v1_lib_pb);
|
||||
var cc_arduino_cli_commands_v1_settings_pb = require('../../../../../cc/arduino/cli/commands/v1/settings_pb.js');
|
||||
goog.object.extend(proto, cc_arduino_cli_commands_v1_settings_pb);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ArchiveSketchRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ArchiveSketchResponse', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.CreateRequest', null, global);
|
||||
@@ -57,7 +59,6 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.v1.NewSketchRequest', null, glo
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.NewSketchResponse', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.SetSketchDefaultsRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.SetSketchDefaultsResponse', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.SketchProfile', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UpdateIndexRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UpdateIndexResponse', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UpdateLibrariesIndexRequest', null, global);
|
||||
@@ -421,27 +422,6 @@ if (goog.DEBUG && !COMPILED) {
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchRequest.displayName = 'proto.cc.arduino.cli.commands.v1.LoadSketchRequest';
|
||||
}
|
||||
/**
|
||||
* 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.SketchProfile = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.cc.arduino.cli.commands.v1.SketchProfile, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
/**
|
||||
* @public
|
||||
* @override
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.displayName = 'proto.cc.arduino.cli.commands.v1.SketchProfile';
|
||||
}
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
* @param {Array=} opt_data Optional initial data array, typically from a
|
||||
@@ -453,7 +433,7 @@ if (goog.DEBUG && !COMPILED) {
|
||||
* @constructor
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.LoadSketchResponse.repeatedFields_, null);
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.cc.arduino.cli.commands.v1.LoadSketchResponse, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
@@ -3222,173 +3202,6 @@ proto.cc.arduino.cli.commands.v1.LoadSketchRequest.prototype.setSketchPath = fun
|
||||
|
||||
|
||||
|
||||
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_<name>, 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.SketchProfile.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.cc.arduino.cli.commands.v1.SketchProfile.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.SketchProfile} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
name: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
||||
fqbn: jspb.Message.getFieldWithDefault(msg, 2, "")
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.SketchProfile}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.cc.arduino.cli.commands.v1.SketchProfile;
|
||||
return proto.cc.arduino.cli.commands.v1.SketchProfile.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.SketchProfile} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.SketchProfile}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setName(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setFqbn(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.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.SketchProfile} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = message.getName();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getFqbn();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string name = 1;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.getName = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.SketchProfile} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.setName = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string fqbn = 2;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.getFqbn = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.SketchProfile} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.prototype.setFqbn = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List of repeated fields within this message type.
|
||||
* @private {!Array<number>}
|
||||
* @const
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.repeatedFields_ = [3,4,5,9];
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto.
|
||||
@@ -3418,17 +3231,7 @@ proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.toObject = functio
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
mainFile: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
||||
locationPath: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
||||
otherSketchFilesList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
|
||||
additionalFilesList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f,
|
||||
rootFolderFilesList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f,
|
||||
defaultFqbn: jspb.Message.getFieldWithDefault(msg, 6, ""),
|
||||
defaultPort: jspb.Message.getFieldWithDefault(msg, 7, ""),
|
||||
defaultProtocol: jspb.Message.getFieldWithDefault(msg, 8, ""),
|
||||
profilesList: jspb.Message.toObjectList(msg.getProfilesList(),
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.toObject, includeInstance),
|
||||
defaultProfile: (f = msg.getDefaultProfile()) && proto.cc.arduino.cli.commands.v1.SketchProfile.toObject(includeInstance, f)
|
||||
sketch: (f = msg.getSketch()) && cc_arduino_cli_commands_v1_common_pb.Sketch.toObject(includeInstance, f)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -3466,46 +3269,9 @@ proto.cc.arduino.cli.commands.v1.LoadSketchResponse.deserializeBinaryFromReader
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setMainFile(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setLocationPath(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.addOtherSketchFiles(value);
|
||||
break;
|
||||
case 4:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.addAdditionalFiles(value);
|
||||
break;
|
||||
case 5:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.addRootFolderFiles(value);
|
||||
break;
|
||||
case 6:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setDefaultFqbn(value);
|
||||
break;
|
||||
case 7:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setDefaultPort(value);
|
||||
break;
|
||||
case 8:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setDefaultProtocol(value);
|
||||
break;
|
||||
case 9:
|
||||
var value = new proto.cc.arduino.cli.commands.v1.SketchProfile;
|
||||
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.SketchProfile.deserializeBinaryFromReader);
|
||||
msg.addProfiles(value);
|
||||
break;
|
||||
case 10:
|
||||
var value = new proto.cc.arduino.cli.commands.v1.SketchProfile;
|
||||
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.SketchProfile.deserializeBinaryFromReader);
|
||||
msg.setDefaultProfile(value);
|
||||
var value = new cc_arduino_cli_commands_v1_common_pb.Sketch;
|
||||
reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Sketch.deserializeBinaryFromReader);
|
||||
msg.setSketch(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
@@ -3536,336 +3302,33 @@ proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.serializeBinary =
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = message.getMainFile();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getLocationPath();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getOtherSketchFilesList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedString(
|
||||
3,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getAdditionalFilesList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedString(
|
||||
4,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getRootFolderFilesList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedString(
|
||||
5,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getDefaultFqbn();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
6,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getDefaultPort();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
7,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getDefaultProtocol();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
8,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getProfilesList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedMessage(
|
||||
9,
|
||||
f,
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = message.getDefaultProfile();
|
||||
f = message.getSketch();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
10,
|
||||
1,
|
||||
f,
|
||||
proto.cc.arduino.cli.commands.v1.SketchProfile.serializeBinaryToWriter
|
||||
cc_arduino_cli_commands_v1_common_pb.Sketch.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string main_file = 1;
|
||||
* @return {string}
|
||||
* optional Sketch sketch = 1;
|
||||
* @return {?proto.cc.arduino.cli.commands.v1.Sketch}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getMainFile = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getSketch = function() {
|
||||
return /** @type{?proto.cc.arduino.cli.commands.v1.Sketch} */ (
|
||||
jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_common_pb.Sketch, 1));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setMainFile = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string location_path = 2;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getLocationPath = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setLocationPath = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated string other_sketch_files = 3;
|
||||
* @return {!Array<string>}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getOtherSketchFilesList = function() {
|
||||
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<string>} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setOtherSketchFilesList = function(value) {
|
||||
return jspb.Message.setField(this, 3, value || []);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.addOtherSketchFiles = 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.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.clearOtherSketchFilesList = function() {
|
||||
return this.setOtherSketchFilesList([]);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated string additional_files = 4;
|
||||
* @return {!Array<string>}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getAdditionalFilesList = function() {
|
||||
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 4));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<string>} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setAdditionalFilesList = function(value) {
|
||||
return jspb.Message.setField(this, 4, value || []);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.addAdditionalFiles = function(value, opt_index) {
|
||||
return jspb.Message.addToRepeatedField(this, 4, value, opt_index);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the list making it empty but non-null.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.clearAdditionalFilesList = function() {
|
||||
return this.setAdditionalFilesList([]);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated string root_folder_files = 5;
|
||||
* @return {!Array<string>}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getRootFolderFilesList = function() {
|
||||
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 5));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<string>} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setRootFolderFilesList = function(value) {
|
||||
return jspb.Message.setField(this, 5, value || []);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.addRootFolderFiles = function(value, opt_index) {
|
||||
return jspb.Message.addToRepeatedField(this, 5, value, opt_index);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the list making it empty but non-null.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.clearRootFolderFilesList = function() {
|
||||
return this.setRootFolderFilesList([]);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string default_fqbn = 6;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getDefaultFqbn = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setDefaultFqbn = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 6, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string default_port = 7;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getDefaultPort = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setDefaultPort = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 7, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string default_protocol = 8;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getDefaultProtocol = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setDefaultProtocol = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 8, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated SketchProfile profiles = 9;
|
||||
* @return {!Array<!proto.cc.arduino.cli.commands.v1.SketchProfile>}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getProfilesList = function() {
|
||||
return /** @type{!Array<!proto.cc.arduino.cli.commands.v1.SketchProfile>} */ (
|
||||
jspb.Message.getRepeatedWrapperField(this, proto.cc.arduino.cli.commands.v1.SketchProfile, 9));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<!proto.cc.arduino.cli.commands.v1.SketchProfile>} value
|
||||
* @param {?proto.cc.arduino.cli.commands.v1.Sketch|undefined} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setProfilesList = function(value) {
|
||||
return jspb.Message.setRepeatedWrapperField(this, 9, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!proto.cc.arduino.cli.commands.v1.SketchProfile=} opt_value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.SketchProfile}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.addProfiles = function(opt_value, opt_index) {
|
||||
return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.cc.arduino.cli.commands.v1.SketchProfile, opt_index);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the list making it empty but non-null.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.clearProfilesList = function() {
|
||||
return this.setProfilesList([]);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional SketchProfile default_profile = 10;
|
||||
* @return {?proto.cc.arduino.cli.commands.v1.SketchProfile}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.getDefaultProfile = function() {
|
||||
return /** @type{?proto.cc.arduino.cli.commands.v1.SketchProfile} */ (
|
||||
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.SketchProfile, 10));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?proto.cc.arduino.cli.commands.v1.SketchProfile|undefined} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setDefaultProfile = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 10, value);
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setSketch = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
@@ -3873,8 +3336,8 @@ proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.setDefaultProfile
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LoadSketchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.clearDefaultProfile = function() {
|
||||
return this.setDefaultProfile(undefined);
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.clearSketch = function() {
|
||||
return this.setSketch(undefined);
|
||||
};
|
||||
|
||||
|
||||
@@ -3882,8 +3345,8 @@ proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.clearDefaultProfil
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.hasDefaultProfile = function() {
|
||||
return jspb.Message.getField(this, 10) != null;
|
||||
proto.cc.arduino.cli.commands.v1.LoadSketchResponse.prototype.hasSketch = function() {
|
||||
return jspb.Message.getField(this, 1) != null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -213,41 +213,16 @@ export namespace MissingProgrammerError {
|
||||
}
|
||||
|
||||
export class Platform extends jspb.Message {
|
||||
getId(): string;
|
||||
setId(value: string): Platform;
|
||||
getInstalled(): string;
|
||||
setInstalled(value: string): Platform;
|
||||
getLatest(): string;
|
||||
setLatest(value: string): Platform;
|
||||
getName(): string;
|
||||
setName(value: string): Platform;
|
||||
getMaintainer(): string;
|
||||
setMaintainer(value: string): Platform;
|
||||
getWebsite(): string;
|
||||
setWebsite(value: string): Platform;
|
||||
getEmail(): string;
|
||||
setEmail(value: string): Platform;
|
||||
clearBoardsList(): void;
|
||||
getBoardsList(): Array<Board>;
|
||||
setBoardsList(value: Array<Board>): Platform;
|
||||
addBoards(value?: Board, index?: number): Board;
|
||||
getManuallyInstalled(): boolean;
|
||||
setManuallyInstalled(value: boolean): Platform;
|
||||
getDeprecated(): boolean;
|
||||
setDeprecated(value: boolean): Platform;
|
||||
clearTypeList(): void;
|
||||
getTypeList(): Array<string>;
|
||||
setTypeList(value: Array<string>): Platform;
|
||||
addType(value: string, index?: number): string;
|
||||
|
||||
hasHelp(): boolean;
|
||||
clearHelp(): void;
|
||||
getHelp(): HelpResources | undefined;
|
||||
setHelp(value?: HelpResources): Platform;
|
||||
getIndexed(): boolean;
|
||||
setIndexed(value: boolean): Platform;
|
||||
getMissingMetadata(): boolean;
|
||||
setMissingMetadata(value: boolean): Platform;
|
||||
hasMetadata(): boolean;
|
||||
clearMetadata(): void;
|
||||
getMetadata(): PlatformMetadata | undefined;
|
||||
setMetadata(value?: PlatformMetadata): Platform;
|
||||
|
||||
hasRelease(): boolean;
|
||||
clearRelease(): void;
|
||||
getRelease(): PlatformRelease | undefined;
|
||||
setRelease(value?: PlatformRelease): Platform;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): Platform.AsObject;
|
||||
@@ -260,21 +235,132 @@ export class Platform extends jspb.Message {
|
||||
}
|
||||
|
||||
export namespace Platform {
|
||||
export type AsObject = {
|
||||
metadata?: PlatformMetadata.AsObject,
|
||||
release?: PlatformRelease.AsObject,
|
||||
}
|
||||
}
|
||||
|
||||
export class PlatformSummary extends jspb.Message {
|
||||
|
||||
hasMetadata(): boolean;
|
||||
clearMetadata(): void;
|
||||
getMetadata(): PlatformMetadata | undefined;
|
||||
setMetadata(value?: PlatformMetadata): PlatformSummary;
|
||||
|
||||
getReleasesMap(): jspb.Map<string, PlatformRelease>;
|
||||
clearReleasesMap(): void;
|
||||
getInstalledVersion(): string;
|
||||
setInstalledVersion(value: string): PlatformSummary;
|
||||
getLatestVersion(): string;
|
||||
setLatestVersion(value: string): PlatformSummary;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): PlatformSummary.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: PlatformSummary): PlatformSummary.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: PlatformSummary, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): PlatformSummary;
|
||||
static deserializeBinaryFromReader(message: PlatformSummary, reader: jspb.BinaryReader): PlatformSummary;
|
||||
}
|
||||
|
||||
export namespace PlatformSummary {
|
||||
export type AsObject = {
|
||||
metadata?: PlatformMetadata.AsObject,
|
||||
|
||||
releasesMap: Array<[string, PlatformRelease.AsObject]>,
|
||||
installedVersion: string,
|
||||
latestVersion: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class PlatformMetadata extends jspb.Message {
|
||||
getId(): string;
|
||||
setId(value: string): PlatformMetadata;
|
||||
getMaintainer(): string;
|
||||
setMaintainer(value: string): PlatformMetadata;
|
||||
getWebsite(): string;
|
||||
setWebsite(value: string): PlatformMetadata;
|
||||
getEmail(): string;
|
||||
setEmail(value: string): PlatformMetadata;
|
||||
getManuallyInstalled(): boolean;
|
||||
setManuallyInstalled(value: boolean): PlatformMetadata;
|
||||
getDeprecated(): boolean;
|
||||
setDeprecated(value: boolean): PlatformMetadata;
|
||||
getIndexed(): boolean;
|
||||
setIndexed(value: boolean): PlatformMetadata;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): PlatformMetadata.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: PlatformMetadata): PlatformMetadata.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: PlatformMetadata, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): PlatformMetadata;
|
||||
static deserializeBinaryFromReader(message: PlatformMetadata, reader: jspb.BinaryReader): PlatformMetadata;
|
||||
}
|
||||
|
||||
export namespace PlatformMetadata {
|
||||
export type AsObject = {
|
||||
id: string,
|
||||
installed: string,
|
||||
latest: string,
|
||||
name: string,
|
||||
maintainer: string,
|
||||
website: string,
|
||||
email: string,
|
||||
boardsList: Array<Board.AsObject>,
|
||||
manuallyInstalled: boolean,
|
||||
deprecated: boolean,
|
||||
typeList: Array<string>,
|
||||
help?: HelpResources.AsObject,
|
||||
indexed: boolean,
|
||||
}
|
||||
}
|
||||
|
||||
export class PlatformRelease extends jspb.Message {
|
||||
getName(): string;
|
||||
setName(value: string): PlatformRelease;
|
||||
getVersion(): string;
|
||||
setVersion(value: string): PlatformRelease;
|
||||
clearTypeList(): void;
|
||||
getTypeList(): Array<string>;
|
||||
setTypeList(value: Array<string>): PlatformRelease;
|
||||
addType(value: string, index?: number): string;
|
||||
getInstalled(): boolean;
|
||||
setInstalled(value: boolean): PlatformRelease;
|
||||
clearBoardsList(): void;
|
||||
getBoardsList(): Array<Board>;
|
||||
setBoardsList(value: Array<Board>): PlatformRelease;
|
||||
addBoards(value?: Board, index?: number): Board;
|
||||
|
||||
hasHelp(): boolean;
|
||||
clearHelp(): void;
|
||||
getHelp(): HelpResources | undefined;
|
||||
setHelp(value?: HelpResources): PlatformRelease;
|
||||
getMissingMetadata(): boolean;
|
||||
setMissingMetadata(value: boolean): PlatformRelease;
|
||||
getDeprecated(): boolean;
|
||||
setDeprecated(value: boolean): PlatformRelease;
|
||||
getCompatible(): boolean;
|
||||
setCompatible(value: boolean): PlatformRelease;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): PlatformRelease.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: PlatformRelease): PlatformRelease.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: PlatformRelease, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): PlatformRelease;
|
||||
static deserializeBinaryFromReader(message: PlatformRelease, reader: jspb.BinaryReader): PlatformRelease;
|
||||
}
|
||||
|
||||
export namespace PlatformRelease {
|
||||
export type AsObject = {
|
||||
name: string,
|
||||
version: string,
|
||||
typeList: Array<string>,
|
||||
installed: boolean,
|
||||
boardsList: Array<Board.AsObject>,
|
||||
help?: HelpResources.AsObject,
|
||||
missingMetadata: boolean,
|
||||
deprecated: boolean,
|
||||
compatible: boolean,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,3 +458,84 @@ export namespace HelpResources {
|
||||
online: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class Sketch extends jspb.Message {
|
||||
getMainFile(): string;
|
||||
setMainFile(value: string): Sketch;
|
||||
getLocationPath(): string;
|
||||
setLocationPath(value: string): Sketch;
|
||||
clearOtherSketchFilesList(): void;
|
||||
getOtherSketchFilesList(): Array<string>;
|
||||
setOtherSketchFilesList(value: Array<string>): Sketch;
|
||||
addOtherSketchFiles(value: string, index?: number): string;
|
||||
clearAdditionalFilesList(): void;
|
||||
getAdditionalFilesList(): Array<string>;
|
||||
setAdditionalFilesList(value: Array<string>): Sketch;
|
||||
addAdditionalFiles(value: string, index?: number): string;
|
||||
clearRootFolderFilesList(): void;
|
||||
getRootFolderFilesList(): Array<string>;
|
||||
setRootFolderFilesList(value: Array<string>): Sketch;
|
||||
addRootFolderFiles(value: string, index?: number): string;
|
||||
getDefaultFqbn(): string;
|
||||
setDefaultFqbn(value: string): Sketch;
|
||||
getDefaultPort(): string;
|
||||
setDefaultPort(value: string): Sketch;
|
||||
getDefaultProtocol(): string;
|
||||
setDefaultProtocol(value: string): Sketch;
|
||||
clearProfilesList(): void;
|
||||
getProfilesList(): Array<SketchProfile>;
|
||||
setProfilesList(value: Array<SketchProfile>): Sketch;
|
||||
addProfiles(value?: SketchProfile, index?: number): SketchProfile;
|
||||
|
||||
hasDefaultProfile(): boolean;
|
||||
clearDefaultProfile(): void;
|
||||
getDefaultProfile(): SketchProfile | undefined;
|
||||
setDefaultProfile(value?: SketchProfile): Sketch;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): Sketch.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: Sketch): Sketch.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: Sketch, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): Sketch;
|
||||
static deserializeBinaryFromReader(message: Sketch, reader: jspb.BinaryReader): Sketch;
|
||||
}
|
||||
|
||||
export namespace Sketch {
|
||||
export type AsObject = {
|
||||
mainFile: string,
|
||||
locationPath: string,
|
||||
otherSketchFilesList: Array<string>,
|
||||
additionalFilesList: Array<string>,
|
||||
rootFolderFilesList: Array<string>,
|
||||
defaultFqbn: string,
|
||||
defaultPort: string,
|
||||
defaultProtocol: string,
|
||||
profilesList: Array<SketchProfile.AsObject>,
|
||||
defaultProfile?: SketchProfile.AsObject,
|
||||
}
|
||||
}
|
||||
|
||||
export class SketchProfile extends jspb.Message {
|
||||
getName(): string;
|
||||
setName(value: string): SketchProfile;
|
||||
getFqbn(): string;
|
||||
setFqbn(value: string): SketchProfile;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SketchProfile.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SketchProfile): SketchProfile.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SketchProfile, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SketchProfile;
|
||||
static deserializeBinaryFromReader(message: SketchProfile, reader: jspb.BinaryReader): SketchProfile;
|
||||
}
|
||||
|
||||
export namespace SketchProfile {
|
||||
export type AsObject = {
|
||||
name: string,
|
||||
fqbn: string,
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -116,43 +116,32 @@ export namespace CompileRequest {
|
||||
}
|
||||
|
||||
export class CompileResponse extends jspb.Message {
|
||||
|
||||
hasOutStream(): boolean;
|
||||
clearOutStream(): void;
|
||||
getOutStream(): Uint8Array | string;
|
||||
getOutStream_asU8(): Uint8Array;
|
||||
getOutStream_asB64(): string;
|
||||
setOutStream(value: Uint8Array | string): CompileResponse;
|
||||
|
||||
hasErrStream(): boolean;
|
||||
clearErrStream(): void;
|
||||
getErrStream(): Uint8Array | string;
|
||||
getErrStream_asU8(): Uint8Array;
|
||||
getErrStream_asB64(): string;
|
||||
setErrStream(value: Uint8Array | string): CompileResponse;
|
||||
getBuildPath(): string;
|
||||
setBuildPath(value: string): CompileResponse;
|
||||
clearUsedLibrariesList(): void;
|
||||
getUsedLibrariesList(): Array<cc_arduino_cli_commands_v1_lib_pb.Library>;
|
||||
setUsedLibrariesList(value: Array<cc_arduino_cli_commands_v1_lib_pb.Library>): CompileResponse;
|
||||
addUsedLibraries(value?: cc_arduino_cli_commands_v1_lib_pb.Library, index?: number): cc_arduino_cli_commands_v1_lib_pb.Library;
|
||||
clearExecutableSectionsSizeList(): void;
|
||||
getExecutableSectionsSizeList(): Array<ExecutableSectionSize>;
|
||||
setExecutableSectionsSizeList(value: Array<ExecutableSectionSize>): CompileResponse;
|
||||
addExecutableSectionsSize(value?: ExecutableSectionSize, index?: number): ExecutableSectionSize;
|
||||
|
||||
hasBoardPlatform(): boolean;
|
||||
clearBoardPlatform(): void;
|
||||
getBoardPlatform(): cc_arduino_cli_commands_v1_common_pb.InstalledPlatformReference | undefined;
|
||||
setBoardPlatform(value?: cc_arduino_cli_commands_v1_common_pb.InstalledPlatformReference): CompileResponse;
|
||||
|
||||
hasBuildPlatform(): boolean;
|
||||
clearBuildPlatform(): void;
|
||||
getBuildPlatform(): cc_arduino_cli_commands_v1_common_pb.InstalledPlatformReference | undefined;
|
||||
setBuildPlatform(value?: cc_arduino_cli_commands_v1_common_pb.InstalledPlatformReference): CompileResponse;
|
||||
|
||||
hasProgress(): boolean;
|
||||
clearProgress(): void;
|
||||
getProgress(): cc_arduino_cli_commands_v1_common_pb.TaskProgress | undefined;
|
||||
setProgress(value?: cc_arduino_cli_commands_v1_common_pb.TaskProgress): CompileResponse;
|
||||
clearBuildPropertiesList(): void;
|
||||
getBuildPropertiesList(): Array<string>;
|
||||
setBuildPropertiesList(value: Array<string>): CompileResponse;
|
||||
addBuildProperties(value: string, index?: number): string;
|
||||
|
||||
hasResult(): boolean;
|
||||
clearResult(): void;
|
||||
getResult(): BuilderResult | undefined;
|
||||
setResult(value?: BuilderResult): CompileResponse;
|
||||
|
||||
getMessageCase(): CompileResponse.MessageCase;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): CompileResponse.AsObject;
|
||||
@@ -168,13 +157,69 @@ export namespace CompileResponse {
|
||||
export type AsObject = {
|
||||
outStream: Uint8Array | string,
|
||||
errStream: Uint8Array | string,
|
||||
progress?: cc_arduino_cli_commands_v1_common_pb.TaskProgress.AsObject,
|
||||
result?: BuilderResult.AsObject,
|
||||
}
|
||||
|
||||
export enum MessageCase {
|
||||
MESSAGE_NOT_SET = 0,
|
||||
OUT_STREAM = 1,
|
||||
ERR_STREAM = 2,
|
||||
PROGRESS = 3,
|
||||
RESULT = 4,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class BuilderResult extends jspb.Message {
|
||||
getBuildPath(): string;
|
||||
setBuildPath(value: string): BuilderResult;
|
||||
clearUsedLibrariesList(): void;
|
||||
getUsedLibrariesList(): Array<cc_arduino_cli_commands_v1_lib_pb.Library>;
|
||||
setUsedLibrariesList(value: Array<cc_arduino_cli_commands_v1_lib_pb.Library>): BuilderResult;
|
||||
addUsedLibraries(value?: cc_arduino_cli_commands_v1_lib_pb.Library, index?: number): cc_arduino_cli_commands_v1_lib_pb.Library;
|
||||
clearExecutableSectionsSizeList(): void;
|
||||
getExecutableSectionsSizeList(): Array<ExecutableSectionSize>;
|
||||
setExecutableSectionsSizeList(value: Array<ExecutableSectionSize>): BuilderResult;
|
||||
addExecutableSectionsSize(value?: ExecutableSectionSize, index?: number): ExecutableSectionSize;
|
||||
|
||||
hasBoardPlatform(): boolean;
|
||||
clearBoardPlatform(): void;
|
||||
getBoardPlatform(): cc_arduino_cli_commands_v1_common_pb.InstalledPlatformReference | undefined;
|
||||
setBoardPlatform(value?: cc_arduino_cli_commands_v1_common_pb.InstalledPlatformReference): BuilderResult;
|
||||
|
||||
hasBuildPlatform(): boolean;
|
||||
clearBuildPlatform(): void;
|
||||
getBuildPlatform(): cc_arduino_cli_commands_v1_common_pb.InstalledPlatformReference | undefined;
|
||||
setBuildPlatform(value?: cc_arduino_cli_commands_v1_common_pb.InstalledPlatformReference): BuilderResult;
|
||||
clearBuildPropertiesList(): void;
|
||||
getBuildPropertiesList(): Array<string>;
|
||||
setBuildPropertiesList(value: Array<string>): BuilderResult;
|
||||
addBuildProperties(value: string, index?: number): string;
|
||||
clearDiagnosticsList(): void;
|
||||
getDiagnosticsList(): Array<CompileDiagnostic>;
|
||||
setDiagnosticsList(value: Array<CompileDiagnostic>): BuilderResult;
|
||||
addDiagnostics(value?: CompileDiagnostic, index?: number): CompileDiagnostic;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): BuilderResult.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: BuilderResult): BuilderResult.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: BuilderResult, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): BuilderResult;
|
||||
static deserializeBinaryFromReader(message: BuilderResult, reader: jspb.BinaryReader): BuilderResult;
|
||||
}
|
||||
|
||||
export namespace BuilderResult {
|
||||
export type AsObject = {
|
||||
buildPath: string,
|
||||
usedLibrariesList: Array<cc_arduino_cli_commands_v1_lib_pb.Library.AsObject>,
|
||||
executableSectionsSizeList: Array<ExecutableSectionSize.AsObject>,
|
||||
boardPlatform?: cc_arduino_cli_commands_v1_common_pb.InstalledPlatformReference.AsObject,
|
||||
buildPlatform?: cc_arduino_cli_commands_v1_common_pb.InstalledPlatformReference.AsObject,
|
||||
progress?: cc_arduino_cli_commands_v1_common_pb.TaskProgress.AsObject,
|
||||
buildPropertiesList: Array<string>,
|
||||
diagnosticsList: Array<CompileDiagnostic.AsObject>,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,3 +248,103 @@ export namespace ExecutableSectionSize {
|
||||
maxSize: number,
|
||||
}
|
||||
}
|
||||
|
||||
export class CompileDiagnostic extends jspb.Message {
|
||||
getSeverity(): string;
|
||||
setSeverity(value: string): CompileDiagnostic;
|
||||
getMessage(): string;
|
||||
setMessage(value: string): CompileDiagnostic;
|
||||
getFile(): string;
|
||||
setFile(value: string): CompileDiagnostic;
|
||||
getLine(): number;
|
||||
setLine(value: number): CompileDiagnostic;
|
||||
getColumn(): number;
|
||||
setColumn(value: number): CompileDiagnostic;
|
||||
clearContextList(): void;
|
||||
getContextList(): Array<CompileDiagnosticContext>;
|
||||
setContextList(value: Array<CompileDiagnosticContext>): CompileDiagnostic;
|
||||
addContext(value?: CompileDiagnosticContext, index?: number): CompileDiagnosticContext;
|
||||
clearNotesList(): void;
|
||||
getNotesList(): Array<CompileDiagnosticNote>;
|
||||
setNotesList(value: Array<CompileDiagnosticNote>): CompileDiagnostic;
|
||||
addNotes(value?: CompileDiagnosticNote, index?: number): CompileDiagnosticNote;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): CompileDiagnostic.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: CompileDiagnostic): CompileDiagnostic.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: CompileDiagnostic, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): CompileDiagnostic;
|
||||
static deserializeBinaryFromReader(message: CompileDiagnostic, reader: jspb.BinaryReader): CompileDiagnostic;
|
||||
}
|
||||
|
||||
export namespace CompileDiagnostic {
|
||||
export type AsObject = {
|
||||
severity: string,
|
||||
message: string,
|
||||
file: string,
|
||||
line: number,
|
||||
column: number,
|
||||
contextList: Array<CompileDiagnosticContext.AsObject>,
|
||||
notesList: Array<CompileDiagnosticNote.AsObject>,
|
||||
}
|
||||
}
|
||||
|
||||
export class CompileDiagnosticContext extends jspb.Message {
|
||||
getMessage(): string;
|
||||
setMessage(value: string): CompileDiagnosticContext;
|
||||
getFile(): string;
|
||||
setFile(value: string): CompileDiagnosticContext;
|
||||
getLine(): number;
|
||||
setLine(value: number): CompileDiagnosticContext;
|
||||
getColumn(): number;
|
||||
setColumn(value: number): CompileDiagnosticContext;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): CompileDiagnosticContext.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: CompileDiagnosticContext): CompileDiagnosticContext.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: CompileDiagnosticContext, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): CompileDiagnosticContext;
|
||||
static deserializeBinaryFromReader(message: CompileDiagnosticContext, reader: jspb.BinaryReader): CompileDiagnosticContext;
|
||||
}
|
||||
|
||||
export namespace CompileDiagnosticContext {
|
||||
export type AsObject = {
|
||||
message: string,
|
||||
file: string,
|
||||
line: number,
|
||||
column: number,
|
||||
}
|
||||
}
|
||||
|
||||
export class CompileDiagnosticNote extends jspb.Message {
|
||||
getMessage(): string;
|
||||
setMessage(value: string): CompileDiagnosticNote;
|
||||
getFile(): string;
|
||||
setFile(value: string): CompileDiagnosticNote;
|
||||
getLine(): number;
|
||||
setLine(value: number): CompileDiagnosticNote;
|
||||
getColumn(): number;
|
||||
setColumn(value: number): CompileDiagnosticNote;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): CompileDiagnosticNote.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: CompileDiagnosticNote): CompileDiagnosticNote.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: CompileDiagnosticNote, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): CompileDiagnosticNote;
|
||||
static deserializeBinaryFromReader(message: CompileDiagnosticNote, reader: jspb.BinaryReader): CompileDiagnosticNote;
|
||||
}
|
||||
|
||||
export namespace CompileDiagnosticNote {
|
||||
export type AsObject = {
|
||||
message: string,
|
||||
file: string,
|
||||
line: number,
|
||||
column: number,
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -299,8 +299,8 @@ export class PlatformSearchRequest extends jspb.Message {
|
||||
setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): PlatformSearchRequest;
|
||||
getSearchArgs(): string;
|
||||
setSearchArgs(value: string): PlatformSearchRequest;
|
||||
getAllVersions(): boolean;
|
||||
setAllVersions(value: boolean): PlatformSearchRequest;
|
||||
getManuallyInstalled(): boolean;
|
||||
setManuallyInstalled(value: boolean): PlatformSearchRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): PlatformSearchRequest.AsObject;
|
||||
@@ -316,15 +316,15 @@ export namespace PlatformSearchRequest {
|
||||
export type AsObject = {
|
||||
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
|
||||
searchArgs: string,
|
||||
allVersions: boolean,
|
||||
manuallyInstalled: boolean,
|
||||
}
|
||||
}
|
||||
|
||||
export class PlatformSearchResponse extends jspb.Message {
|
||||
clearSearchOutputList(): void;
|
||||
getSearchOutputList(): Array<cc_arduino_cli_commands_v1_common_pb.Platform>;
|
||||
setSearchOutputList(value: Array<cc_arduino_cli_commands_v1_common_pb.Platform>): PlatformSearchResponse;
|
||||
addSearchOutput(value?: cc_arduino_cli_commands_v1_common_pb.Platform, index?: number): cc_arduino_cli_commands_v1_common_pb.Platform;
|
||||
getSearchOutputList(): Array<cc_arduino_cli_commands_v1_common_pb.PlatformSummary>;
|
||||
setSearchOutputList(value: Array<cc_arduino_cli_commands_v1_common_pb.PlatformSummary>): PlatformSearchResponse;
|
||||
addSearchOutput(value?: cc_arduino_cli_commands_v1_common_pb.PlatformSummary, index?: number): cc_arduino_cli_commands_v1_common_pb.PlatformSummary;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): PlatformSearchResponse.AsObject;
|
||||
@@ -338,57 +338,6 @@ export class PlatformSearchResponse extends jspb.Message {
|
||||
|
||||
export namespace PlatformSearchResponse {
|
||||
export type AsObject = {
|
||||
searchOutputList: Array<cc_arduino_cli_commands_v1_common_pb.Platform.AsObject>,
|
||||
}
|
||||
}
|
||||
|
||||
export class PlatformListRequest 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): PlatformListRequest;
|
||||
getUpdatableOnly(): boolean;
|
||||
setUpdatableOnly(value: boolean): PlatformListRequest;
|
||||
getAll(): boolean;
|
||||
setAll(value: boolean): PlatformListRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): PlatformListRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: PlatformListRequest): PlatformListRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: PlatformListRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): PlatformListRequest;
|
||||
static deserializeBinaryFromReader(message: PlatformListRequest, reader: jspb.BinaryReader): PlatformListRequest;
|
||||
}
|
||||
|
||||
export namespace PlatformListRequest {
|
||||
export type AsObject = {
|
||||
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
|
||||
updatableOnly: boolean,
|
||||
all: boolean,
|
||||
}
|
||||
}
|
||||
|
||||
export class PlatformListResponse extends jspb.Message {
|
||||
clearInstalledPlatformsList(): void;
|
||||
getInstalledPlatformsList(): Array<cc_arduino_cli_commands_v1_common_pb.Platform>;
|
||||
setInstalledPlatformsList(value: Array<cc_arduino_cli_commands_v1_common_pb.Platform>): PlatformListResponse;
|
||||
addInstalledPlatforms(value?: cc_arduino_cli_commands_v1_common_pb.Platform, index?: number): cc_arduino_cli_commands_v1_common_pb.Platform;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): PlatformListResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: PlatformListResponse): PlatformListResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: PlatformListResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): PlatformListResponse;
|
||||
static deserializeBinaryFromReader(message: PlatformListResponse, reader: jspb.BinaryReader): PlatformListResponse;
|
||||
}
|
||||
|
||||
export namespace PlatformListResponse {
|
||||
export type AsObject = {
|
||||
installedPlatformsList: Array<cc_arduino_cli_commands_v1_common_pb.Platform.AsObject>,
|
||||
searchOutputList: Array<cc_arduino_cli_commands_v1_common_pb.PlatformSummary.AsObject>,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,6 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformDownloadRequest', nu
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformDownloadResponse', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformInstallRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformInstallResponse', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformListRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformListResponse', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformLoadingError', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformSearchRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.PlatformSearchResponse', null, global);
|
||||
@@ -289,48 +287,6 @@ if (goog.DEBUG && !COMPILED) {
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformSearchResponse.displayName = 'proto.cc.arduino.cli.commands.v1.PlatformSearchResponse';
|
||||
}
|
||||
/**
|
||||
* 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.PlatformListRequest = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.cc.arduino.cli.commands.v1.PlatformListRequest, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
/**
|
||||
* @public
|
||||
* @override
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.displayName = 'proto.cc.arduino.cli.commands.v1.PlatformListRequest';
|
||||
}
|
||||
/**
|
||||
* 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.PlatformListResponse = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, proto.cc.arduino.cli.commands.v1.PlatformListResponse.repeatedFields_, null);
|
||||
};
|
||||
goog.inherits(proto.cc.arduino.cli.commands.v1.PlatformListResponse, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
/**
|
||||
* @public
|
||||
* @override
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListResponse.displayName = 'proto.cc.arduino.cli.commands.v1.PlatformListResponse';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2408,7 +2364,7 @@ proto.cc.arduino.cli.commands.v1.PlatformSearchRequest.toObject = function(inclu
|
||||
var f, obj = {
|
||||
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
|
||||
searchArgs: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
||||
allVersions: jspb.Message.getBooleanFieldWithDefault(msg, 3, false)
|
||||
manuallyInstalled: jspb.Message.getBooleanFieldWithDefault(msg, 3, false)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -2456,7 +2412,7 @@ proto.cc.arduino.cli.commands.v1.PlatformSearchRequest.deserializeBinaryFromRead
|
||||
break;
|
||||
case 3:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setAllVersions(value);
|
||||
msg.setManuallyInstalled(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
@@ -2502,7 +2458,7 @@ proto.cc.arduino.cli.commands.v1.PlatformSearchRequest.serializeBinaryToWriter =
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getAllVersions();
|
||||
f = message.getManuallyInstalled();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
3,
|
||||
@@ -2568,10 +2524,10 @@ proto.cc.arduino.cli.commands.v1.PlatformSearchRequest.prototype.setSearchArgs =
|
||||
|
||||
|
||||
/**
|
||||
* optional bool all_versions = 3;
|
||||
* optional bool manually_installed = 3;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformSearchRequest.prototype.getAllVersions = function() {
|
||||
proto.cc.arduino.cli.commands.v1.PlatformSearchRequest.prototype.getManuallyInstalled = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
|
||||
};
|
||||
|
||||
@@ -2580,7 +2536,7 @@ proto.cc.arduino.cli.commands.v1.PlatformSearchRequest.prototype.getAllVersions
|
||||
* @param {boolean} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.PlatformSearchRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformSearchRequest.prototype.setAllVersions = function(value) {
|
||||
proto.cc.arduino.cli.commands.v1.PlatformSearchRequest.prototype.setManuallyInstalled = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 3, value);
|
||||
};
|
||||
|
||||
@@ -2625,7 +2581,7 @@ proto.cc.arduino.cli.commands.v1.PlatformSearchResponse.prototype.toObject = fun
|
||||
proto.cc.arduino.cli.commands.v1.PlatformSearchResponse.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
searchOutputList: jspb.Message.toObjectList(msg.getSearchOutputList(),
|
||||
cc_arduino_cli_commands_v1_common_pb.Platform.toObject, includeInstance)
|
||||
cc_arduino_cli_commands_v1_common_pb.PlatformSummary.toObject, includeInstance)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -2663,8 +2619,8 @@ proto.cc.arduino.cli.commands.v1.PlatformSearchResponse.deserializeBinaryFromRea
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = new cc_arduino_cli_commands_v1_common_pb.Platform;
|
||||
reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Platform.deserializeBinaryFromReader);
|
||||
var value = new cc_arduino_cli_commands_v1_common_pb.PlatformSummary;
|
||||
reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.PlatformSummary.deserializeBinaryFromReader);
|
||||
msg.addSearchOutput(value);
|
||||
break;
|
||||
default:
|
||||
@@ -2701,24 +2657,24 @@ proto.cc.arduino.cli.commands.v1.PlatformSearchResponse.serializeBinaryToWriter
|
||||
writer.writeRepeatedMessage(
|
||||
1,
|
||||
f,
|
||||
cc_arduino_cli_commands_v1_common_pb.Platform.serializeBinaryToWriter
|
||||
cc_arduino_cli_commands_v1_common_pb.PlatformSummary.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated Platform search_output = 1;
|
||||
* @return {!Array<!proto.cc.arduino.cli.commands.v1.Platform>}
|
||||
* repeated PlatformSummary search_output = 1;
|
||||
* @return {!Array<!proto.cc.arduino.cli.commands.v1.PlatformSummary>}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformSearchResponse.prototype.getSearchOutputList = function() {
|
||||
return /** @type{!Array<!proto.cc.arduino.cli.commands.v1.Platform>} */ (
|
||||
jspb.Message.getRepeatedWrapperField(this, cc_arduino_cli_commands_v1_common_pb.Platform, 1));
|
||||
return /** @type{!Array<!proto.cc.arduino.cli.commands.v1.PlatformSummary>} */ (
|
||||
jspb.Message.getRepeatedWrapperField(this, cc_arduino_cli_commands_v1_common_pb.PlatformSummary, 1));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<!proto.cc.arduino.cli.commands.v1.Platform>} value
|
||||
* @param {!Array<!proto.cc.arduino.cli.commands.v1.PlatformSummary>} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.PlatformSearchResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformSearchResponse.prototype.setSearchOutputList = function(value) {
|
||||
@@ -2727,12 +2683,12 @@ proto.cc.arduino.cli.commands.v1.PlatformSearchResponse.prototype.setSearchOutpu
|
||||
|
||||
|
||||
/**
|
||||
* @param {!proto.cc.arduino.cli.commands.v1.Platform=} opt_value
|
||||
* @param {!proto.cc.arduino.cli.commands.v1.PlatformSummary=} opt_value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.Platform}
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.PlatformSummary}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformSearchResponse.prototype.addSearchOutput = function(opt_value, opt_index) {
|
||||
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.cc.arduino.cli.commands.v1.Platform, opt_index);
|
||||
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.cc.arduino.cli.commands.v1.PlatformSummary, opt_index);
|
||||
};
|
||||
|
||||
|
||||
@@ -2745,375 +2701,4 @@ proto.cc.arduino.cli.commands.v1.PlatformSearchResponse.prototype.clearSearchOut
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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_<name>, 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.PlatformListRequest.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.cc.arduino.cli.commands.v1.PlatformListRequest.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.PlatformListRequest} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
|
||||
updatableOnly: jspb.Message.getBooleanFieldWithDefault(msg, 2, false),
|
||||
all: 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.PlatformListRequest}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.cc.arduino.cli.commands.v1.PlatformListRequest;
|
||||
return proto.cc.arduino.cli.commands.v1.PlatformListRequest.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.PlatformListRequest} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.PlatformListRequest}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.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 {boolean} */ (reader.readBool());
|
||||
msg.setUpdatableOnly(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setAll(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.PlatformListRequest.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.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.PlatformListRequest} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.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.getUpdatableOnly();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getAll();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
3,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional Instance instance = 1;
|
||||
* @return {?proto.cc.arduino.cli.commands.v1.Instance}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.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.PlatformListRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.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.PlatformListRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.prototype.clearInstance = function() {
|
||||
return this.setInstance(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.prototype.hasInstance = function() {
|
||||
return jspb.Message.getField(this, 1) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool updatable_only = 2;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.prototype.getUpdatableOnly = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.PlatformListRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.prototype.setUpdatableOnly = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool all = 3;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.prototype.getAll = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.PlatformListRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListRequest.prototype.setAll = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 3, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List of repeated fields within this message type.
|
||||
* @private {!Array<number>}
|
||||
* @const
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListResponse.repeatedFields_ = [1];
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto.
|
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||
* Optional fields that are not set will be set to undefined.
|
||||
* To access a reserved field use, foo.pb_<name>, 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.PlatformListResponse.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.cc.arduino.cli.commands.v1.PlatformListResponse.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.PlatformListResponse} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListResponse.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
installedPlatformsList: jspb.Message.toObjectList(msg.getInstalledPlatformsList(),
|
||||
cc_arduino_cli_commands_v1_common_pb.Platform.toObject, includeInstance)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.PlatformListResponse}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListResponse.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.cc.arduino.cli.commands.v1.PlatformListResponse;
|
||||
return proto.cc.arduino.cli.commands.v1.PlatformListResponse.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.PlatformListResponse} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.PlatformListResponse}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListResponse.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.Platform;
|
||||
reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Platform.deserializeBinaryFromReader);
|
||||
msg.addInstalledPlatforms(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.PlatformListResponse.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListResponse.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.PlatformListResponse} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListResponse.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = message.getInstalledPlatformsList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedMessage(
|
||||
1,
|
||||
f,
|
||||
cc_arduino_cli_commands_v1_common_pb.Platform.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated Platform installed_platforms = 1;
|
||||
* @return {!Array<!proto.cc.arduino.cli.commands.v1.Platform>}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListResponse.prototype.getInstalledPlatformsList = function() {
|
||||
return /** @type{!Array<!proto.cc.arduino.cli.commands.v1.Platform>} */ (
|
||||
jspb.Message.getRepeatedWrapperField(this, cc_arduino_cli_commands_v1_common_pb.Platform, 1));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<!proto.cc.arduino.cli.commands.v1.Platform>} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.PlatformListResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListResponse.prototype.setInstalledPlatformsList = function(value) {
|
||||
return jspb.Message.setRepeatedWrapperField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!proto.cc.arduino.cli.commands.v1.Platform=} opt_value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.Platform}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListResponse.prototype.addInstalledPlatforms = function(opt_value, opt_index) {
|
||||
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.cc.arduino.cli.commands.v1.Platform, opt_index);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the list making it empty but non-null.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.PlatformListResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.PlatformListResponse.prototype.clearInstalledPlatformsList = function() {
|
||||
return this.setInstalledPlatformsList([]);
|
||||
};
|
||||
|
||||
|
||||
goog.object.extend(exports, proto.cc.arduino.cli.commands.v1);
|
||||
|
||||
@@ -298,6 +298,8 @@ export class LibraryResolveDependenciesRequest extends jspb.Message {
|
||||
setName(value: string): LibraryResolveDependenciesRequest;
|
||||
getVersion(): string;
|
||||
setVersion(value: string): LibraryResolveDependenciesRequest;
|
||||
getDoNotUpdateInstalledLibraries(): boolean;
|
||||
setDoNotUpdateInstalledLibraries(value: boolean): LibraryResolveDependenciesRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): LibraryResolveDependenciesRequest.AsObject;
|
||||
@@ -314,6 +316,7 @@ export namespace LibraryResolveDependenciesRequest {
|
||||
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
|
||||
name: string,
|
||||
version: string,
|
||||
doNotUpdateInstalledLibraries: boolean,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,8 +374,6 @@ export class LibrarySearchRequest 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): LibrarySearchRequest;
|
||||
getQuery(): string;
|
||||
setQuery(value: string): LibrarySearchRequest;
|
||||
getOmitReleasesDetails(): boolean;
|
||||
setOmitReleasesDetails(value: boolean): LibrarySearchRequest;
|
||||
getSearchArgs(): string;
|
||||
@@ -391,7 +392,6 @@ export class LibrarySearchRequest extends jspb.Message {
|
||||
export namespace LibrarySearchRequest {
|
||||
export type AsObject = {
|
||||
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
|
||||
query: string,
|
||||
omitReleasesDetails: boolean,
|
||||
searchArgs: string,
|
||||
}
|
||||
|
||||
@@ -2648,7 +2648,8 @@ proto.cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest.toObject = fu
|
||||
var f, obj = {
|
||||
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
|
||||
name: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
||||
version: jspb.Message.getFieldWithDefault(msg, 3, "")
|
||||
version: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
||||
doNotUpdateInstalledLibraries: jspb.Message.getBooleanFieldWithDefault(msg, 4, false)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -2698,6 +2699,10 @@ proto.cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest.deserializeBi
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setVersion(value);
|
||||
break;
|
||||
case 4:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setDoNotUpdateInstalledLibraries(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@@ -2749,6 +2754,13 @@ proto.cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest.serializeBina
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getDoNotUpdateInstalledLibraries();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
4,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2825,6 +2837,24 @@ proto.cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest.prototype.set
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool do_not_update_installed_libraries = 4;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest.prototype.getDoNotUpdateInstalledLibraries = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest.prototype.setDoNotUpdateInstalledLibraries = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 4, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List of repeated fields within this message type.
|
||||
@@ -3208,9 +3238,8 @@ proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.toObject = funct
|
||||
proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
|
||||
query: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
||||
omitReleasesDetails: jspb.Message.getBooleanFieldWithDefault(msg, 3, false),
|
||||
searchArgs: jspb.Message.getFieldWithDefault(msg, 4, "")
|
||||
omitReleasesDetails: jspb.Message.getBooleanFieldWithDefault(msg, 2, false),
|
||||
searchArgs: jspb.Message.getFieldWithDefault(msg, 3, "")
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -3253,14 +3282,10 @@ proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.deserializeBinaryFromReade
|
||||
msg.setInstance(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setQuery(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setOmitReleasesDetails(value);
|
||||
break;
|
||||
case 4:
|
||||
case 3:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setSearchArgs(value);
|
||||
break;
|
||||
@@ -3301,24 +3326,17 @@ proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.serializeBinaryToWriter =
|
||||
cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = message.getQuery();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getOmitReleasesDetails();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
3,
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getSearchArgs();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
4,
|
||||
3,
|
||||
f
|
||||
);
|
||||
}
|
||||
@@ -3363,29 +3381,11 @@ proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.hasInstance = fu
|
||||
|
||||
|
||||
/**
|
||||
* optional string query = 2;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.getQuery = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LibrarySearchRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.setQuery = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool omit_releases_details = 3;
|
||||
* optional bool omit_releases_details = 2;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.getOmitReleasesDetails = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
|
||||
};
|
||||
|
||||
|
||||
@@ -3394,16 +3394,16 @@ proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.getOmitReleasesD
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LibrarySearchRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.setOmitReleasesDetails = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 3, value);
|
||||
return jspb.Message.setProto3BooleanField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string search_args = 4;
|
||||
* optional string search_args = 3;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.getSearchArgs = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
||||
};
|
||||
|
||||
|
||||
@@ -3412,7 +3412,7 @@ proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.getSearchArgs =
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.LibrarySearchRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.LibrarySearchRequest.prototype.setSearchArgs = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 4, value);
|
||||
return jspb.Message.setProto3StringField(this, 3, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -10,26 +10,29 @@ import * as cc_arduino_cli_commands_v1_port_pb from "../../../../../cc/arduino/c
|
||||
|
||||
export class MonitorRequest 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): MonitorRequest;
|
||||
hasOpenRequest(): boolean;
|
||||
clearOpenRequest(): void;
|
||||
getOpenRequest(): MonitorPortOpenRequest | undefined;
|
||||
setOpenRequest(value?: MonitorPortOpenRequest): MonitorRequest;
|
||||
|
||||
hasPort(): boolean;
|
||||
clearPort(): void;
|
||||
getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined;
|
||||
setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): MonitorRequest;
|
||||
getFqbn(): string;
|
||||
setFqbn(value: string): MonitorRequest;
|
||||
hasTxData(): boolean;
|
||||
clearTxData(): void;
|
||||
getTxData(): Uint8Array | string;
|
||||
getTxData_asU8(): Uint8Array;
|
||||
getTxData_asB64(): string;
|
||||
setTxData(value: Uint8Array | string): MonitorRequest;
|
||||
|
||||
hasPortConfiguration(): boolean;
|
||||
clearPortConfiguration(): void;
|
||||
getPortConfiguration(): MonitorPortConfiguration | undefined;
|
||||
setPortConfiguration(value?: MonitorPortConfiguration): MonitorRequest;
|
||||
hasUpdatedConfiguration(): boolean;
|
||||
clearUpdatedConfiguration(): void;
|
||||
getUpdatedConfiguration(): MonitorPortConfiguration | undefined;
|
||||
setUpdatedConfiguration(value?: MonitorPortConfiguration): MonitorRequest;
|
||||
|
||||
hasClose(): boolean;
|
||||
clearClose(): void;
|
||||
getClose(): boolean;
|
||||
setClose(value: boolean): MonitorRequest;
|
||||
|
||||
getMessageCase(): MonitorRequest.MessageCase;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): MonitorRequest.AsObject;
|
||||
@@ -42,11 +45,57 @@ export class MonitorRequest extends jspb.Message {
|
||||
}
|
||||
|
||||
export namespace MonitorRequest {
|
||||
export type AsObject = {
|
||||
openRequest?: MonitorPortOpenRequest.AsObject,
|
||||
txData: Uint8Array | string,
|
||||
updatedConfiguration?: MonitorPortConfiguration.AsObject,
|
||||
close: boolean,
|
||||
}
|
||||
|
||||
export enum MessageCase {
|
||||
MESSAGE_NOT_SET = 0,
|
||||
OPEN_REQUEST = 1,
|
||||
TX_DATA = 2,
|
||||
UPDATED_CONFIGURATION = 3,
|
||||
CLOSE = 4,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class MonitorPortOpenRequest 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): MonitorPortOpenRequest;
|
||||
|
||||
hasPort(): boolean;
|
||||
clearPort(): void;
|
||||
getPort(): cc_arduino_cli_commands_v1_port_pb.Port | undefined;
|
||||
setPort(value?: cc_arduino_cli_commands_v1_port_pb.Port): MonitorPortOpenRequest;
|
||||
getFqbn(): string;
|
||||
setFqbn(value: string): MonitorPortOpenRequest;
|
||||
|
||||
hasPortConfiguration(): boolean;
|
||||
clearPortConfiguration(): void;
|
||||
getPortConfiguration(): MonitorPortConfiguration | undefined;
|
||||
setPortConfiguration(value?: MonitorPortConfiguration): MonitorPortOpenRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): MonitorPortOpenRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: MonitorPortOpenRequest): MonitorPortOpenRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: MonitorPortOpenRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): MonitorPortOpenRequest;
|
||||
static deserializeBinaryFromReader(message: MonitorPortOpenRequest, reader: jspb.BinaryReader): MonitorPortOpenRequest;
|
||||
}
|
||||
|
||||
export namespace MonitorPortOpenRequest {
|
||||
export type AsObject = {
|
||||
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
|
||||
port?: cc_arduino_cli_commands_v1_port_pb.Port.AsObject,
|
||||
fqbn: string,
|
||||
txData: Uint8Array | string,
|
||||
portConfiguration?: MonitorPortConfiguration.AsObject,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,11 @@ goog.object.extend(proto, cc_arduino_cli_commands_v1_port_pb);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsResponse', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorPortSetting', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorPortSettingDescriptor', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorRequest.MessageCase', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorResponse', null, global);
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
@@ -43,7 +45,7 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.v1.MonitorResponse', null, glob
|
||||
* @constructor
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.cc.arduino.cli.commands.v1.MonitorRequest.oneofGroups_);
|
||||
};
|
||||
goog.inherits(proto.cc.arduino.cli.commands.v1.MonitorRequest, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
@@ -53,6 +55,27 @@ if (goog.DEBUG && !COMPILED) {
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.displayName = 'proto.cc.arduino.cli.commands.v1.MonitorRequest';
|
||||
}
|
||||
/**
|
||||
* 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.MonitorPortOpenRequest = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
/**
|
||||
* @public
|
||||
* @override
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.displayName = 'proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest';
|
||||
}
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
* @param {Array=} opt_data Optional initial data array, typically from a
|
||||
@@ -180,6 +203,34 @@ if (goog.DEBUG && !COMPILED) {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortSettingDescriptor.displayName = 'proto.cc.arduino.cli.commands.v1.MonitorPortSettingDescriptor';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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<!Array<number>>}
|
||||
* @const
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.oneofGroups_ = [[1,2,3,4]];
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.MessageCase = {
|
||||
MESSAGE_NOT_SET: 0,
|
||||
OPEN_REQUEST: 1,
|
||||
TX_DATA: 2,
|
||||
UPDATED_CONFIGURATION: 3,
|
||||
CLOSE: 4
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {proto.cc.arduino.cli.commands.v1.MonitorRequest.MessageCase}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getMessageCase = function() {
|
||||
return /** @type {proto.cc.arduino.cli.commands.v1.MonitorRequest.MessageCase} */(jspb.Message.computeOneofCase(this, proto.cc.arduino.cli.commands.v1.MonitorRequest.oneofGroups_[0]));
|
||||
};
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
@@ -211,11 +262,10 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.toObject = function(op
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
|
||||
port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f),
|
||||
fqbn: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
||||
openRequest: (f = msg.getOpenRequest()) && proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.toObject(includeInstance, f),
|
||||
txData: msg.getTxData_asB64(),
|
||||
portConfiguration: (f = msg.getPortConfiguration()) && proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.toObject(includeInstance, f)
|
||||
updatedConfiguration: (f = msg.getUpdatedConfiguration()) && proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.toObject(includeInstance, f),
|
||||
close: jspb.Message.getBooleanFieldWithDefault(msg, 4, false)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -253,27 +303,22 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.deserializeBinaryFromReader = fu
|
||||
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);
|
||||
var value = new proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest;
|
||||
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.deserializeBinaryFromReader);
|
||||
msg.setOpenRequest(value);
|
||||
break;
|
||||
case 2:
|
||||
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 3:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setFqbn(value);
|
||||
break;
|
||||
case 4:
|
||||
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
||||
msg.setTxData(value);
|
||||
break;
|
||||
case 5:
|
||||
case 3:
|
||||
var value = new proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration;
|
||||
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.deserializeBinaryFromReader);
|
||||
msg.setPortConfiguration(value);
|
||||
msg.setUpdatedConfiguration(value);
|
||||
break;
|
||||
case 4:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setClose(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
@@ -303,6 +348,329 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.serializeBinary = func
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = message.getOpenRequest();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
1,
|
||||
f,
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2));
|
||||
if (f != null) {
|
||||
writer.writeBytes(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getUpdatedConfiguration();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
3,
|
||||
f,
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = /** @type {boolean} */ (jspb.Message.getField(message, 4));
|
||||
if (f != null) {
|
||||
writer.writeBool(
|
||||
4,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional MonitorPortOpenRequest open_request = 1;
|
||||
* @return {?proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getOpenRequest = function() {
|
||||
return /** @type{?proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest} */ (
|
||||
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest, 1));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest|undefined} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.setOpenRequest = function(value) {
|
||||
return jspb.Message.setOneofWrapperField(this, 1, proto.cc.arduino.cli.commands.v1.MonitorRequest.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.clearOpenRequest = function() {
|
||||
return this.setOpenRequest(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.hasOpenRequest = function() {
|
||||
return jspb.Message.getField(this, 1) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes tx_data = 2;
|
||||
* @return {!(string|Uint8Array)}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getTxData = function() {
|
||||
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes tx_data = 2;
|
||||
* This is a type-conversion wrapper around `getTxData()`
|
||||
* @return {string}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getTxData_asB64 = function() {
|
||||
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
||||
this.getTxData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes tx_data = 2;
|
||||
* Note that Uint8Array is not supported on all browsers.
|
||||
* @see http://caniuse.com/Uint8Array
|
||||
* This is a type-conversion wrapper around `getTxData()`
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getTxData_asU8 = function() {
|
||||
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
||||
this.getTxData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!(string|Uint8Array)} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.setTxData = function(value) {
|
||||
return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.commands.v1.MonitorRequest.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.clearTxData = function() {
|
||||
return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.commands.v1.MonitorRequest.oneofGroups_[0], undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.hasTxData = function() {
|
||||
return jspb.Message.getField(this, 2) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional MonitorPortConfiguration updated_configuration = 3;
|
||||
* @return {?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getUpdatedConfiguration = function() {
|
||||
return /** @type{?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} */ (
|
||||
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration, 3));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration|undefined} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.setUpdatedConfiguration = function(value) {
|
||||
return jspb.Message.setOneofWrapperField(this, 3, proto.cc.arduino.cli.commands.v1.MonitorRequest.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.clearUpdatedConfiguration = function() {
|
||||
return this.setUpdatedConfiguration(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.hasUpdatedConfiguration = function() {
|
||||
return jspb.Message.getField(this, 3) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool close = 4;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getClose = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.setClose = function(value) {
|
||||
return jspb.Message.setOneofField(this, 4, proto.cc.arduino.cli.commands.v1.MonitorRequest.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.clearClose = function() {
|
||||
return jspb.Message.setOneofField(this, 4, proto.cc.arduino.cli.commands.v1.MonitorRequest.oneofGroups_[0], undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.hasClose = function() {
|
||||
return jspb.Message.getField(this, 4) != 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_<name>, 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.MonitorPortOpenRequest.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.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.MonitorPortOpenRequest} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
|
||||
port: (f = msg.getPort()) && cc_arduino_cli_commands_v1_port_pb.Port.toObject(includeInstance, f),
|
||||
fqbn: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
||||
portConfiguration: (f = msg.getPortConfiguration()) && proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.toObject(includeInstance, 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.MonitorPortOpenRequest}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest;
|
||||
return proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.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.MonitorPortOpenRequest} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.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 = 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 3:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setFqbn(value);
|
||||
break;
|
||||
case 4:
|
||||
var value = new proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration;
|
||||
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.deserializeBinaryFromReader);
|
||||
msg.setPortConfiguration(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.MonitorPortOpenRequest.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.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.MonitorPortOpenRequest} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = message.getInstance();
|
||||
if (f != null) {
|
||||
@@ -327,17 +695,10 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.serializeBinaryToWriter = functi
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getTxData_asU8();
|
||||
if (f.length > 0) {
|
||||
writer.writeBytes(
|
||||
4,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getPortConfiguration();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
5,
|
||||
4,
|
||||
f,
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration.serializeBinaryToWriter
|
||||
);
|
||||
@@ -349,7 +710,7 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.serializeBinaryToWriter = functi
|
||||
* optional Instance instance = 1;
|
||||
* @return {?proto.cc.arduino.cli.commands.v1.Instance}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getInstance = function() {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.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));
|
||||
};
|
||||
@@ -357,18 +718,18 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getInstance = function
|
||||
|
||||
/**
|
||||
* @param {?proto.cc.arduino.cli.commands.v1.Instance|undefined} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.setInstance = function(value) {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.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.MonitorRequest} returns this
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.clearInstance = function() {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.clearInstance = function() {
|
||||
return this.setInstance(undefined);
|
||||
};
|
||||
|
||||
@@ -377,7 +738,7 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.clearInstance = functi
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.hasInstance = function() {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.hasInstance = function() {
|
||||
return jspb.Message.getField(this, 1) != null;
|
||||
};
|
||||
|
||||
@@ -386,7 +747,7 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.hasInstance = function
|
||||
* optional Port port = 2;
|
||||
* @return {?proto.cc.arduino.cli.commands.v1.Port}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getPort = function() {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.getPort = function() {
|
||||
return /** @type{?proto.cc.arduino.cli.commands.v1.Port} */ (
|
||||
jspb.Message.getWrapperField(this, cc_arduino_cli_commands_v1_port_pb.Port, 2));
|
||||
};
|
||||
@@ -394,18 +755,18 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getPort = function() {
|
||||
|
||||
/**
|
||||
* @param {?proto.cc.arduino.cli.commands.v1.Port|undefined} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.setPort = function(value) {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.setPort = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.clearPort = function() {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.clearPort = function() {
|
||||
return this.setPort(undefined);
|
||||
};
|
||||
|
||||
@@ -414,7 +775,7 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.clearPort = function()
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.hasPort = function() {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.hasPort = function() {
|
||||
return jspb.Message.getField(this, 2) != null;
|
||||
};
|
||||
|
||||
@@ -423,86 +784,44 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.hasPort = function() {
|
||||
* optional string fqbn = 3;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getFqbn = function() {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.getFqbn = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.setFqbn = function(value) {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.setFqbn = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 3, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes tx_data = 4;
|
||||
* @return {!(string|Uint8Array)}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getTxData = function() {
|
||||
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes tx_data = 4;
|
||||
* This is a type-conversion wrapper around `getTxData()`
|
||||
* @return {string}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getTxData_asB64 = function() {
|
||||
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
||||
this.getTxData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes tx_data = 4;
|
||||
* Note that Uint8Array is not supported on all browsers.
|
||||
* @see http://caniuse.com/Uint8Array
|
||||
* This is a type-conversion wrapper around `getTxData()`
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getTxData_asU8 = function() {
|
||||
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
||||
this.getTxData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!(string|Uint8Array)} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.setTxData = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 4, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional MonitorPortConfiguration port_configuration = 5;
|
||||
* optional MonitorPortConfiguration port_configuration = 4;
|
||||
* @return {?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.getPortConfiguration = function() {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.getPortConfiguration = function() {
|
||||
return /** @type{?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration} */ (
|
||||
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration, 5));
|
||||
jspb.Message.getWrapperField(this, proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration, 4));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?proto.cc.arduino.cli.commands.v1.MonitorPortConfiguration|undefined} value
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.setPortConfiguration = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 5, value);
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.setPortConfiguration = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 4, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorRequest} returns this
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.clearPortConfiguration = function() {
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.clearPortConfiguration = function() {
|
||||
return this.setPortConfiguration(undefined);
|
||||
};
|
||||
|
||||
@@ -511,8 +830,8 @@ proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.clearPortConfiguration
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.MonitorRequest.prototype.hasPortConfiguration = function() {
|
||||
return jspb.Message.getField(this, 5) != null;
|
||||
proto.cc.arduino.cli.commands.v1.MonitorPortOpenRequest.prototype.hasPortConfiguration = function() {
|
||||
return jspb.Message.getField(this, 4) != null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
// GENERATED CODE -- NO SERVICES IN PROTO
|
||||
238
arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/settings_pb.d.ts
vendored
Normal file
238
arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/settings_pb.d.ts
vendored
Normal file
@@ -0,0 +1,238 @@
|
||||
// package: cc.arduino.cli.commands.v1
|
||||
// file: cc/arduino/cli/commands/v1/settings.proto
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import * as jspb from "google-protobuf";
|
||||
|
||||
export class SettingsGetAllResponse extends jspb.Message {
|
||||
getJsonData(): string;
|
||||
setJsonData(value: string): SettingsGetAllResponse;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsGetAllResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsGetAllResponse): SettingsGetAllResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsGetAllResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsGetAllResponse;
|
||||
static deserializeBinaryFromReader(message: SettingsGetAllResponse, reader: jspb.BinaryReader): SettingsGetAllResponse;
|
||||
}
|
||||
|
||||
export namespace SettingsGetAllResponse {
|
||||
export type AsObject = {
|
||||
jsonData: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class SettingsMergeRequest extends jspb.Message {
|
||||
getJsonData(): string;
|
||||
setJsonData(value: string): SettingsMergeRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsMergeRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsMergeRequest): SettingsMergeRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsMergeRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsMergeRequest;
|
||||
static deserializeBinaryFromReader(message: SettingsMergeRequest, reader: jspb.BinaryReader): SettingsMergeRequest;
|
||||
}
|
||||
|
||||
export namespace SettingsMergeRequest {
|
||||
export type AsObject = {
|
||||
jsonData: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class SettingsGetValueResponse extends jspb.Message {
|
||||
getKey(): string;
|
||||
setKey(value: string): SettingsGetValueResponse;
|
||||
getJsonData(): string;
|
||||
setJsonData(value: string): SettingsGetValueResponse;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsGetValueResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsGetValueResponse): SettingsGetValueResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsGetValueResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsGetValueResponse;
|
||||
static deserializeBinaryFromReader(message: SettingsGetValueResponse, reader: jspb.BinaryReader): SettingsGetValueResponse;
|
||||
}
|
||||
|
||||
export namespace SettingsGetValueResponse {
|
||||
export type AsObject = {
|
||||
key: string,
|
||||
jsonData: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class SettingsSetValueRequest extends jspb.Message {
|
||||
getKey(): string;
|
||||
setKey(value: string): SettingsSetValueRequest;
|
||||
getJsonData(): string;
|
||||
setJsonData(value: string): SettingsSetValueRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsSetValueRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsSetValueRequest): SettingsSetValueRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsSetValueRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsSetValueRequest;
|
||||
static deserializeBinaryFromReader(message: SettingsSetValueRequest, reader: jspb.BinaryReader): SettingsSetValueRequest;
|
||||
}
|
||||
|
||||
export namespace SettingsSetValueRequest {
|
||||
export type AsObject = {
|
||||
key: string,
|
||||
jsonData: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class SettingsGetAllRequest extends jspb.Message {
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsGetAllRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsGetAllRequest): SettingsGetAllRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsGetAllRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsGetAllRequest;
|
||||
static deserializeBinaryFromReader(message: SettingsGetAllRequest, reader: jspb.BinaryReader): SettingsGetAllRequest;
|
||||
}
|
||||
|
||||
export namespace SettingsGetAllRequest {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class SettingsGetValueRequest extends jspb.Message {
|
||||
getKey(): string;
|
||||
setKey(value: string): SettingsGetValueRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsGetValueRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsGetValueRequest): SettingsGetValueRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsGetValueRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsGetValueRequest;
|
||||
static deserializeBinaryFromReader(message: SettingsGetValueRequest, reader: jspb.BinaryReader): SettingsGetValueRequest;
|
||||
}
|
||||
|
||||
export namespace SettingsGetValueRequest {
|
||||
export type AsObject = {
|
||||
key: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class SettingsMergeResponse extends jspb.Message {
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsMergeResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsMergeResponse): SettingsMergeResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsMergeResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsMergeResponse;
|
||||
static deserializeBinaryFromReader(message: SettingsMergeResponse, reader: jspb.BinaryReader): SettingsMergeResponse;
|
||||
}
|
||||
|
||||
export namespace SettingsMergeResponse {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class SettingsSetValueResponse extends jspb.Message {
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsSetValueResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsSetValueResponse): SettingsSetValueResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsSetValueResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsSetValueResponse;
|
||||
static deserializeBinaryFromReader(message: SettingsSetValueResponse, reader: jspb.BinaryReader): SettingsSetValueResponse;
|
||||
}
|
||||
|
||||
export namespace SettingsSetValueResponse {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class SettingsWriteRequest extends jspb.Message {
|
||||
getFilePath(): string;
|
||||
setFilePath(value: string): SettingsWriteRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsWriteRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsWriteRequest): SettingsWriteRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsWriteRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsWriteRequest;
|
||||
static deserializeBinaryFromReader(message: SettingsWriteRequest, reader: jspb.BinaryReader): SettingsWriteRequest;
|
||||
}
|
||||
|
||||
export namespace SettingsWriteRequest {
|
||||
export type AsObject = {
|
||||
filePath: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class SettingsWriteResponse extends jspb.Message {
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsWriteResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsWriteResponse): SettingsWriteResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsWriteResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsWriteResponse;
|
||||
static deserializeBinaryFromReader(message: SettingsWriteResponse, reader: jspb.BinaryReader): SettingsWriteResponse;
|
||||
}
|
||||
|
||||
export namespace SettingsWriteResponse {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class SettingsDeleteRequest extends jspb.Message {
|
||||
getKey(): string;
|
||||
setKey(value: string): SettingsDeleteRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsDeleteRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsDeleteRequest): SettingsDeleteRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsDeleteRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsDeleteRequest;
|
||||
static deserializeBinaryFromReader(message: SettingsDeleteRequest, reader: jspb.BinaryReader): SettingsDeleteRequest;
|
||||
}
|
||||
|
||||
export namespace SettingsDeleteRequest {
|
||||
export type AsObject = {
|
||||
key: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class SettingsDeleteResponse extends jspb.Message {
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SettingsDeleteResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SettingsDeleteResponse): SettingsDeleteResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SettingsDeleteResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SettingsDeleteResponse;
|
||||
static deserializeBinaryFromReader(message: SettingsDeleteResponse, reader: jspb.BinaryReader): SettingsDeleteResponse;
|
||||
}
|
||||
|
||||
export namespace SettingsDeleteResponse {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -214,15 +214,23 @@ export namespace UploadUsingProgrammerRequest {
|
||||
}
|
||||
|
||||
export class UploadUsingProgrammerResponse extends jspb.Message {
|
||||
|
||||
hasOutStream(): boolean;
|
||||
clearOutStream(): void;
|
||||
getOutStream(): Uint8Array | string;
|
||||
getOutStream_asU8(): Uint8Array;
|
||||
getOutStream_asB64(): string;
|
||||
setOutStream(value: Uint8Array | string): UploadUsingProgrammerResponse;
|
||||
|
||||
hasErrStream(): boolean;
|
||||
clearErrStream(): void;
|
||||
getErrStream(): Uint8Array | string;
|
||||
getErrStream_asU8(): Uint8Array;
|
||||
getErrStream_asB64(): string;
|
||||
setErrStream(value: Uint8Array | string): UploadUsingProgrammerResponse;
|
||||
|
||||
getMessageCase(): UploadUsingProgrammerResponse.MessageCase;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): UploadUsingProgrammerResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: UploadUsingProgrammerResponse): UploadUsingProgrammerResponse.AsObject;
|
||||
@@ -238,6 +246,13 @@ export namespace UploadUsingProgrammerResponse {
|
||||
outStream: Uint8Array | string,
|
||||
errStream: Uint8Array | string,
|
||||
}
|
||||
|
||||
export enum MessageCase {
|
||||
MESSAGE_NOT_SET = 0,
|
||||
OUT_STREAM = 1,
|
||||
ERR_STREAM = 2,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class BurnBootloaderRequest extends jspb.Message {
|
||||
@@ -290,15 +305,23 @@ export namespace BurnBootloaderRequest {
|
||||
}
|
||||
|
||||
export class BurnBootloaderResponse extends jspb.Message {
|
||||
|
||||
hasOutStream(): boolean;
|
||||
clearOutStream(): void;
|
||||
getOutStream(): Uint8Array | string;
|
||||
getOutStream_asU8(): Uint8Array;
|
||||
getOutStream_asB64(): string;
|
||||
setOutStream(value: Uint8Array | string): BurnBootloaderResponse;
|
||||
|
||||
hasErrStream(): boolean;
|
||||
clearErrStream(): void;
|
||||
getErrStream(): Uint8Array | string;
|
||||
getErrStream_asU8(): Uint8Array;
|
||||
getErrStream_asB64(): string;
|
||||
setErrStream(value: Uint8Array | string): BurnBootloaderResponse;
|
||||
|
||||
getMessageCase(): BurnBootloaderResponse.MessageCase;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): BurnBootloaderResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: BurnBootloaderResponse): BurnBootloaderResponse.AsObject;
|
||||
@@ -314,6 +337,13 @@ export namespace BurnBootloaderResponse {
|
||||
outStream: Uint8Array | string,
|
||||
errStream: Uint8Array | string,
|
||||
}
|
||||
|
||||
export enum MessageCase {
|
||||
MESSAGE_NOT_SET = 0,
|
||||
OUT_STREAM = 1,
|
||||
ERR_STREAM = 2,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class ListProgrammersAvailableForUploadRequest extends jspb.Message {
|
||||
|
||||
@@ -27,6 +27,7 @@ var cc_arduino_cli_commands_v1_port_pb = require('../../../../../cc/arduino/cli/
|
||||
goog.object.extend(proto, cc_arduino_cli_commands_v1_port_pb);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.MessageCase', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError', null, global);
|
||||
@@ -38,6 +39,7 @@ goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UploadResponse.MessageCase',
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UploadResult', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.MessageCase', null, global);
|
||||
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.UserField', null, global);
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
@@ -155,7 +157,7 @@ if (goog.DEBUG && !COMPILED) {
|
||||
* @constructor
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.oneofGroups_);
|
||||
};
|
||||
goog.inherits(proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
@@ -197,7 +199,7 @@ if (goog.DEBUG && !COMPILED) {
|
||||
* @constructor
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.oneofGroups_);
|
||||
};
|
||||
goog.inherits(proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
@@ -1837,6 +1839,32 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerRequest.prototype.clearUse
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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<!Array<number>>}
|
||||
* @const
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.oneofGroups_ = [[1,2]];
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.MessageCase = {
|
||||
MESSAGE_NOT_SET: 0,
|
||||
OUT_STREAM: 1,
|
||||
ERR_STREAM: 2
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.MessageCase}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.prototype.getMessageCase = function() {
|
||||
return /** @type {proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.MessageCase} */(jspb.Message.computeOneofCase(this, proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.oneofGroups_[0]));
|
||||
};
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
@@ -1943,15 +1971,15 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.prototype.seriali
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = message.getOutStream_asU8();
|
||||
if (f.length > 0) {
|
||||
f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1));
|
||||
if (f != null) {
|
||||
writer.writeBytes(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getErrStream_asU8();
|
||||
if (f.length > 0) {
|
||||
f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2));
|
||||
if (f != null) {
|
||||
writer.writeBytes(
|
||||
2,
|
||||
f
|
||||
@@ -1998,7 +2026,25 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.prototype.getOutS
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.prototype.setOutStream = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 1, value);
|
||||
return jspb.Message.setOneofField(this, 1, proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.prototype.clearOutStream = function() {
|
||||
return jspb.Message.setOneofField(this, 1, proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.oneofGroups_[0], undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.prototype.hasOutStream = function() {
|
||||
return jspb.Message.getField(this, 1) != null;
|
||||
};
|
||||
|
||||
|
||||
@@ -2040,7 +2086,25 @@ proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.prototype.getErrS
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.prototype.setErrStream = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 2, value);
|
||||
return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.prototype.clearErrStream = function() {
|
||||
return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.oneofGroups_[0], undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse.prototype.hasErrStream = function() {
|
||||
return jspb.Message.getField(this, 2) != null;
|
||||
};
|
||||
|
||||
|
||||
@@ -2430,6 +2494,32 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderRequest.prototype.clearUserFields
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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<!Array<number>>}
|
||||
* @const
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.oneofGroups_ = [[1,2]];
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.MessageCase = {
|
||||
MESSAGE_NOT_SET: 0,
|
||||
OUT_STREAM: 1,
|
||||
ERR_STREAM: 2
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.MessageCase}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.prototype.getMessageCase = function() {
|
||||
return /** @type {proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.MessageCase} */(jspb.Message.computeOneofCase(this, proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.oneofGroups_[0]));
|
||||
};
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
@@ -2536,15 +2626,15 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.prototype.serializeBinar
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = message.getOutStream_asU8();
|
||||
if (f.length > 0) {
|
||||
f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1));
|
||||
if (f != null) {
|
||||
writer.writeBytes(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getErrStream_asU8();
|
||||
if (f.length > 0) {
|
||||
f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2));
|
||||
if (f != null) {
|
||||
writer.writeBytes(
|
||||
2,
|
||||
f
|
||||
@@ -2591,7 +2681,25 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.prototype.getOutStream_a
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.prototype.setOutStream = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 1, value);
|
||||
return jspb.Message.setOneofField(this, 1, proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.prototype.clearOutStream = function() {
|
||||
return jspb.Message.setOneofField(this, 1, proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.oneofGroups_[0], undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.prototype.hasOutStream = function() {
|
||||
return jspb.Message.getField(this, 1) != null;
|
||||
};
|
||||
|
||||
|
||||
@@ -2633,7 +2741,25 @@ proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.prototype.getErrStream_a
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.prototype.setErrStream = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 2, value);
|
||||
return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.prototype.clearErrStream = function() {
|
||||
return jspb.Message.setOneofField(this, 2, proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.oneofGroups_[0], undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.v1.BurnBootloaderResponse.prototype.hasErrStream = function() {
|
||||
return jspb.Message.getField(this, 2) != null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
// package: cc.arduino.cli.settings.v1
|
||||
// file: cc/arduino/cli/settings/v1/settings.proto
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import * as grpc from "@grpc/grpc-js";
|
||||
import * as cc_arduino_cli_settings_v1_settings_pb from "../../../../../cc/arduino/cli/settings/v1/settings_pb";
|
||||
|
||||
interface ISettingsServiceService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
|
||||
getAll: ISettingsServiceService_IGetAll;
|
||||
merge: ISettingsServiceService_IMerge;
|
||||
getValue: ISettingsServiceService_IGetValue;
|
||||
setValue: ISettingsServiceService_ISetValue;
|
||||
write: ISettingsServiceService_IWrite;
|
||||
delete: ISettingsServiceService_IDelete;
|
||||
}
|
||||
|
||||
interface ISettingsServiceService_IGetAll extends grpc.MethodDefinition<cc_arduino_cli_settings_v1_settings_pb.GetAllRequest, cc_arduino_cli_settings_v1_settings_pb.GetAllResponse> {
|
||||
path: "/cc.arduino.cli.settings.v1.SettingsService/GetAll";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.GetAllRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.GetAllRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.GetAllResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.GetAllResponse>;
|
||||
}
|
||||
interface ISettingsServiceService_IMerge extends grpc.MethodDefinition<cc_arduino_cli_settings_v1_settings_pb.MergeRequest, cc_arduino_cli_settings_v1_settings_pb.MergeResponse> {
|
||||
path: "/cc.arduino.cli.settings.v1.SettingsService/Merge";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.MergeRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.MergeRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.MergeResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.MergeResponse>;
|
||||
}
|
||||
interface ISettingsServiceService_IGetValue extends grpc.MethodDefinition<cc_arduino_cli_settings_v1_settings_pb.GetValueRequest, cc_arduino_cli_settings_v1_settings_pb.GetValueResponse> {
|
||||
path: "/cc.arduino.cli.settings.v1.SettingsService/GetValue";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.GetValueRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.GetValueRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.GetValueResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.GetValueResponse>;
|
||||
}
|
||||
interface ISettingsServiceService_ISetValue extends grpc.MethodDefinition<cc_arduino_cli_settings_v1_settings_pb.SetValueRequest, cc_arduino_cli_settings_v1_settings_pb.SetValueResponse> {
|
||||
path: "/cc.arduino.cli.settings.v1.SettingsService/SetValue";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.SetValueRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.SetValueRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.SetValueResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.SetValueResponse>;
|
||||
}
|
||||
interface ISettingsServiceService_IWrite extends grpc.MethodDefinition<cc_arduino_cli_settings_v1_settings_pb.WriteRequest, cc_arduino_cli_settings_v1_settings_pb.WriteResponse> {
|
||||
path: "/cc.arduino.cli.settings.v1.SettingsService/Write";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.WriteRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.WriteRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.WriteResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.WriteResponse>;
|
||||
}
|
||||
interface ISettingsServiceService_IDelete extends grpc.MethodDefinition<cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, cc_arduino_cli_settings_v1_settings_pb.DeleteResponse> {
|
||||
path: "/cc.arduino.cli.settings.v1.SettingsService/Delete";
|
||||
requestStream: false;
|
||||
responseStream: false;
|
||||
requestSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.DeleteRequest>;
|
||||
requestDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.DeleteRequest>;
|
||||
responseSerialize: grpc.serialize<cc_arduino_cli_settings_v1_settings_pb.DeleteResponse>;
|
||||
responseDeserialize: grpc.deserialize<cc_arduino_cli_settings_v1_settings_pb.DeleteResponse>;
|
||||
}
|
||||
|
||||
export const SettingsServiceService: ISettingsServiceService;
|
||||
|
||||
export interface ISettingsServiceServer extends grpc.UntypedServiceImplementation {
|
||||
getAll: grpc.handleUnaryCall<cc_arduino_cli_settings_v1_settings_pb.GetAllRequest, cc_arduino_cli_settings_v1_settings_pb.GetAllResponse>;
|
||||
merge: grpc.handleUnaryCall<cc_arduino_cli_settings_v1_settings_pb.MergeRequest, cc_arduino_cli_settings_v1_settings_pb.MergeResponse>;
|
||||
getValue: grpc.handleUnaryCall<cc_arduino_cli_settings_v1_settings_pb.GetValueRequest, cc_arduino_cli_settings_v1_settings_pb.GetValueResponse>;
|
||||
setValue: grpc.handleUnaryCall<cc_arduino_cli_settings_v1_settings_pb.SetValueRequest, cc_arduino_cli_settings_v1_settings_pb.SetValueResponse>;
|
||||
write: grpc.handleUnaryCall<cc_arduino_cli_settings_v1_settings_pb.WriteRequest, cc_arduino_cli_settings_v1_settings_pb.WriteResponse>;
|
||||
delete: grpc.handleUnaryCall<cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, cc_arduino_cli_settings_v1_settings_pb.DeleteResponse>;
|
||||
}
|
||||
|
||||
export interface ISettingsServiceClient {
|
||||
getAll(request: cc_arduino_cli_settings_v1_settings_pb.GetAllRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
getAll(request: cc_arduino_cli_settings_v1_settings_pb.GetAllRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
getAll(request: cc_arduino_cli_settings_v1_settings_pb.GetAllRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
merge(request: cc_arduino_cli_settings_v1_settings_pb.MergeRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
|
||||
merge(request: cc_arduino_cli_settings_v1_settings_pb.MergeRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
|
||||
merge(request: cc_arduino_cli_settings_v1_settings_pb.MergeRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
|
||||
getValue(request: cc_arduino_cli_settings_v1_settings_pb.GetValueRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
getValue(request: cc_arduino_cli_settings_v1_settings_pb.GetValueRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
getValue(request: cc_arduino_cli_settings_v1_settings_pb.GetValueRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
setValue(request: cc_arduino_cli_settings_v1_settings_pb.SetValueRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
setValue(request: cc_arduino_cli_settings_v1_settings_pb.SetValueRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
setValue(request: cc_arduino_cli_settings_v1_settings_pb.SetValueRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall;
|
||||
write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall;
|
||||
write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall;
|
||||
delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
}
|
||||
|
||||
export class SettingsServiceClient extends grpc.Client implements ISettingsServiceClient {
|
||||
constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial<grpc.ClientOptions>);
|
||||
public getAll(request: cc_arduino_cli_settings_v1_settings_pb.GetAllRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
public getAll(request: cc_arduino_cli_settings_v1_settings_pb.GetAllRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
public getAll(request: cc_arduino_cli_settings_v1_settings_pb.GetAllRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetAllResponse) => void): grpc.ClientUnaryCall;
|
||||
public merge(request: cc_arduino_cli_settings_v1_settings_pb.MergeRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
|
||||
public merge(request: cc_arduino_cli_settings_v1_settings_pb.MergeRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
|
||||
public merge(request: cc_arduino_cli_settings_v1_settings_pb.MergeRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.MergeResponse) => void): grpc.ClientUnaryCall;
|
||||
public getValue(request: cc_arduino_cli_settings_v1_settings_pb.GetValueRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public getValue(request: cc_arduino_cli_settings_v1_settings_pb.GetValueRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public getValue(request: cc_arduino_cli_settings_v1_settings_pb.GetValueRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.GetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public setValue(request: cc_arduino_cli_settings_v1_settings_pb.SetValueRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public setValue(request: cc_arduino_cli_settings_v1_settings_pb.SetValueRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public setValue(request: cc_arduino_cli_settings_v1_settings_pb.SetValueRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.SetValueResponse) => void): grpc.ClientUnaryCall;
|
||||
public write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall;
|
||||
public write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall;
|
||||
public write(request: cc_arduino_cli_settings_v1_settings_pb.WriteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.WriteResponse) => void): grpc.ClientUnaryCall;
|
||||
public delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
public delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
public delete(request: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse) => void): grpc.ClientUnaryCall;
|
||||
}
|
||||
@@ -1,231 +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_settings_v1_settings_pb = require('../../../../../cc/arduino/cli/settings/v1/settings_pb.js');
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_DeleteRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.DeleteRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.DeleteRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_DeleteRequest(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.DeleteRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_DeleteResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.DeleteResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.DeleteResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_DeleteResponse(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.DeleteResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_GetAllRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.GetAllRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.GetAllRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_GetAllRequest(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.GetAllRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_GetAllResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.GetAllResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.GetAllResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_GetAllResponse(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.GetAllResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_GetValueRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.GetValueRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.GetValueRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_GetValueRequest(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.GetValueRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_GetValueResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.GetValueResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.GetValueResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_GetValueResponse(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.GetValueResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_MergeRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.MergeRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.MergeRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_MergeRequest(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.MergeRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_MergeResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.MergeResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.MergeResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_MergeResponse(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.MergeResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_SetValueRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.SetValueRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.SetValueRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_SetValueRequest(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.SetValueRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_SetValueResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.SetValueResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.SetValueResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_SetValueResponse(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.SetValueResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_WriteRequest(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.WriteRequest)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.WriteRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_WriteRequest(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.WriteRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_cc_arduino_cli_settings_v1_WriteResponse(arg) {
|
||||
if (!(arg instanceof cc_arduino_cli_settings_v1_settings_pb.WriteResponse)) {
|
||||
throw new Error('Expected argument of type cc.arduino.cli.settings.v1.WriteResponse');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_cc_arduino_cli_settings_v1_WriteResponse(buffer_arg) {
|
||||
return cc_arduino_cli_settings_v1_settings_pb.WriteResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
|
||||
// The SettingsService provides an interface to Arduino CLI configuration
|
||||
// options
|
||||
var SettingsServiceService = exports['cc.arduino.cli.settings.v1.SettingsService'] = {
|
||||
// List all the settings.
|
||||
getAll: {
|
||||
path: '/cc.arduino.cli.settings.v1.SettingsService/GetAll',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_settings_v1_settings_pb.GetAllRequest,
|
||||
responseType: cc_arduino_cli_settings_v1_settings_pb.GetAllResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_settings_v1_GetAllRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_settings_v1_GetAllRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_settings_v1_GetAllResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_settings_v1_GetAllResponse,
|
||||
},
|
||||
// Set multiple settings values at once.
|
||||
merge: {
|
||||
path: '/cc.arduino.cli.settings.v1.SettingsService/Merge',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_settings_v1_settings_pb.MergeRequest,
|
||||
responseType: cc_arduino_cli_settings_v1_settings_pb.MergeResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_settings_v1_MergeRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_settings_v1_MergeRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_settings_v1_MergeResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_settings_v1_MergeResponse,
|
||||
},
|
||||
// Get the value of a specific setting.
|
||||
getValue: {
|
||||
path: '/cc.arduino.cli.settings.v1.SettingsService/GetValue',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_settings_v1_settings_pb.GetValueRequest,
|
||||
responseType: cc_arduino_cli_settings_v1_settings_pb.GetValueResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_settings_v1_GetValueRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_settings_v1_GetValueRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_settings_v1_GetValueResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_settings_v1_GetValueResponse,
|
||||
},
|
||||
// Set the value of a specific setting.
|
||||
setValue: {
|
||||
path: '/cc.arduino.cli.settings.v1.SettingsService/SetValue',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_settings_v1_settings_pb.SetValueRequest,
|
||||
responseType: cc_arduino_cli_settings_v1_settings_pb.SetValueResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_settings_v1_SetValueRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_settings_v1_SetValueRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_settings_v1_SetValueResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_settings_v1_SetValueResponse,
|
||||
},
|
||||
// Writes to file settings currently stored in memory
|
||||
write: {
|
||||
path: '/cc.arduino.cli.settings.v1.SettingsService/Write',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_settings_v1_settings_pb.WriteRequest,
|
||||
responseType: cc_arduino_cli_settings_v1_settings_pb.WriteResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_settings_v1_WriteRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_settings_v1_WriteRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_settings_v1_WriteResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_settings_v1_WriteResponse,
|
||||
},
|
||||
// Deletes an entry and rewrites the file settings
|
||||
delete: {
|
||||
path: '/cc.arduino.cli.settings.v1.SettingsService/Delete',
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: cc_arduino_cli_settings_v1_settings_pb.DeleteRequest,
|
||||
responseType: cc_arduino_cli_settings_v1_settings_pb.DeleteResponse,
|
||||
requestSerialize: serialize_cc_arduino_cli_settings_v1_DeleteRequest,
|
||||
requestDeserialize: deserialize_cc_arduino_cli_settings_v1_DeleteRequest,
|
||||
responseSerialize: serialize_cc_arduino_cli_settings_v1_DeleteResponse,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_settings_v1_DeleteResponse,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,238 +0,0 @@
|
||||
// package: cc.arduino.cli.settings.v1
|
||||
// file: cc/arduino/cli/settings/v1/settings.proto
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import * as jspb from "google-protobuf";
|
||||
|
||||
export class GetAllResponse extends jspb.Message {
|
||||
getJsonData(): string;
|
||||
setJsonData(value: string): GetAllResponse;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): GetAllResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: GetAllResponse): GetAllResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: GetAllResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): GetAllResponse;
|
||||
static deserializeBinaryFromReader(message: GetAllResponse, reader: jspb.BinaryReader): GetAllResponse;
|
||||
}
|
||||
|
||||
export namespace GetAllResponse {
|
||||
export type AsObject = {
|
||||
jsonData: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class MergeRequest extends jspb.Message {
|
||||
getJsonData(): string;
|
||||
setJsonData(value: string): MergeRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): MergeRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: MergeRequest): MergeRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: MergeRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): MergeRequest;
|
||||
static deserializeBinaryFromReader(message: MergeRequest, reader: jspb.BinaryReader): MergeRequest;
|
||||
}
|
||||
|
||||
export namespace MergeRequest {
|
||||
export type AsObject = {
|
||||
jsonData: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class GetValueResponse extends jspb.Message {
|
||||
getKey(): string;
|
||||
setKey(value: string): GetValueResponse;
|
||||
getJsonData(): string;
|
||||
setJsonData(value: string): GetValueResponse;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): GetValueResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: GetValueResponse): GetValueResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: GetValueResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): GetValueResponse;
|
||||
static deserializeBinaryFromReader(message: GetValueResponse, reader: jspb.BinaryReader): GetValueResponse;
|
||||
}
|
||||
|
||||
export namespace GetValueResponse {
|
||||
export type AsObject = {
|
||||
key: string,
|
||||
jsonData: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class SetValueRequest extends jspb.Message {
|
||||
getKey(): string;
|
||||
setKey(value: string): SetValueRequest;
|
||||
getJsonData(): string;
|
||||
setJsonData(value: string): SetValueRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SetValueRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SetValueRequest): SetValueRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SetValueRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SetValueRequest;
|
||||
static deserializeBinaryFromReader(message: SetValueRequest, reader: jspb.BinaryReader): SetValueRequest;
|
||||
}
|
||||
|
||||
export namespace SetValueRequest {
|
||||
export type AsObject = {
|
||||
key: string,
|
||||
jsonData: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class GetAllRequest extends jspb.Message {
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): GetAllRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: GetAllRequest): GetAllRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: GetAllRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): GetAllRequest;
|
||||
static deserializeBinaryFromReader(message: GetAllRequest, reader: jspb.BinaryReader): GetAllRequest;
|
||||
}
|
||||
|
||||
export namespace GetAllRequest {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class GetValueRequest extends jspb.Message {
|
||||
getKey(): string;
|
||||
setKey(value: string): GetValueRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): GetValueRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: GetValueRequest): GetValueRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: GetValueRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): GetValueRequest;
|
||||
static deserializeBinaryFromReader(message: GetValueRequest, reader: jspb.BinaryReader): GetValueRequest;
|
||||
}
|
||||
|
||||
export namespace GetValueRequest {
|
||||
export type AsObject = {
|
||||
key: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class MergeResponse extends jspb.Message {
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): MergeResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: MergeResponse): MergeResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: MergeResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): MergeResponse;
|
||||
static deserializeBinaryFromReader(message: MergeResponse, reader: jspb.BinaryReader): MergeResponse;
|
||||
}
|
||||
|
||||
export namespace MergeResponse {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class SetValueResponse extends jspb.Message {
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SetValueResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SetValueResponse): SetValueResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SetValueResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SetValueResponse;
|
||||
static deserializeBinaryFromReader(message: SetValueResponse, reader: jspb.BinaryReader): SetValueResponse;
|
||||
}
|
||||
|
||||
export namespace SetValueResponse {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class WriteRequest extends jspb.Message {
|
||||
getFilePath(): string;
|
||||
setFilePath(value: string): WriteRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): WriteRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: WriteRequest): WriteRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: WriteRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): WriteRequest;
|
||||
static deserializeBinaryFromReader(message: WriteRequest, reader: jspb.BinaryReader): WriteRequest;
|
||||
}
|
||||
|
||||
export namespace WriteRequest {
|
||||
export type AsObject = {
|
||||
filePath: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class WriteResponse extends jspb.Message {
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): WriteResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: WriteResponse): WriteResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: WriteResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): WriteResponse;
|
||||
static deserializeBinaryFromReader(message: WriteResponse, reader: jspb.BinaryReader): WriteResponse;
|
||||
}
|
||||
|
||||
export namespace WriteResponse {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class DeleteRequest extends jspb.Message {
|
||||
getKey(): string;
|
||||
setKey(value: string): DeleteRequest;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): DeleteRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: DeleteRequest): DeleteRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: DeleteRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): DeleteRequest;
|
||||
static deserializeBinaryFromReader(message: DeleteRequest, reader: jspb.BinaryReader): DeleteRequest;
|
||||
}
|
||||
|
||||
export namespace DeleteRequest {
|
||||
export type AsObject = {
|
||||
key: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class DeleteResponse extends jspb.Message {
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): DeleteResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: DeleteResponse): DeleteResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: DeleteResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): DeleteResponse;
|
||||
static deserializeBinaryFromReader(message: DeleteResponse, reader: jspb.BinaryReader): DeleteResponse;
|
||||
}
|
||||
|
||||
export namespace DeleteResponse {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import { promises as fs } from 'node:fs';
|
||||
import { dirname } from 'node:path';
|
||||
import yaml from 'js-yaml';
|
||||
import * as grpc from '@grpc/grpc-js';
|
||||
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
||||
import URI from '@theia/core/lib/common/uri';
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
@@ -16,18 +15,17 @@ import {
|
||||
ConfigState,
|
||||
} from '../common/protocol';
|
||||
import { spawnCommand } from './exec-util';
|
||||
import {
|
||||
MergeRequest,
|
||||
WriteRequest,
|
||||
} from './cli-protocol/cc/arduino/cli/settings/v1/settings_pb';
|
||||
import { SettingsServiceClient } from './cli-protocol/cc/arduino/cli/settings/v1/settings_grpc_pb';
|
||||
import * as serviceGrpcPb from './cli-protocol/cc/arduino/cli/settings/v1/settings_grpc_pb';
|
||||
import { ArduinoDaemonImpl } from './arduino-daemon-impl';
|
||||
import { DefaultCliConfig, CLI_CONFIG } from './cli-config';
|
||||
import { Deferred } from '@theia/core/lib/common/promise-util';
|
||||
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
||||
import { deepClone, nls } from '@theia/core';
|
||||
import { ErrnoException } from './utils/errors';
|
||||
import {
|
||||
SettingsMergeRequest,
|
||||
SettingsWriteRequest,
|
||||
} from './cli-protocol/cc/arduino/cli/commands/v1/settings_pb';
|
||||
import { createArduinoCoreServiceClient } from './arduino-core-service-client';
|
||||
|
||||
const deepmerge = require('deepmerge');
|
||||
|
||||
@@ -97,7 +95,7 @@ export class ConfigServiceImpl
|
||||
};
|
||||
copyDefaultCliConfig.locale = locale || 'en';
|
||||
const proxy = Network.stringify(network);
|
||||
copyDefaultCliConfig.network = { proxy };
|
||||
copyDefaultCliConfig.network = proxy ? { proxy } : {}; // must be an empty object to unset the default prop with the `WriteRequest`.
|
||||
|
||||
// always use the port of the daemon
|
||||
const port = await this.daemon.getPort();
|
||||
@@ -293,16 +291,16 @@ export class ConfigServiceImpl
|
||||
}
|
||||
|
||||
private async updateDaemon(
|
||||
port: string | number,
|
||||
port: number | number,
|
||||
config: DefaultCliConfig
|
||||
): Promise<void> {
|
||||
const client = this.createClient(port);
|
||||
const req = new MergeRequest();
|
||||
const client = createArduinoCoreServiceClient({ port });
|
||||
const req = new SettingsMergeRequest();
|
||||
const json = JSON.stringify(config, null, 2);
|
||||
req.setJsonData(json);
|
||||
this.logger.info(`Updating daemon with 'data': ${json}`);
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
client.merge(req, (error) => {
|
||||
client.settingsMerge(req, (error) => {
|
||||
try {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -316,14 +314,14 @@ export class ConfigServiceImpl
|
||||
});
|
||||
}
|
||||
|
||||
private async writeDaemonState(port: string | number): Promise<void> {
|
||||
const client = this.createClient(port);
|
||||
const req = new WriteRequest();
|
||||
private async writeDaemonState(port: number | number): Promise<void> {
|
||||
const client = createArduinoCoreServiceClient({ port });
|
||||
const req = new SettingsWriteRequest();
|
||||
const cliConfigUri = await this.getCliConfigFileUri();
|
||||
const cliConfigPath = FileUri.fsPath(cliConfigUri);
|
||||
req.setFilePath(cliConfigPath);
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
client.write(req, (error) => {
|
||||
client.settingsWrite(req, (error) => {
|
||||
try {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -337,19 +335,6 @@ export class ConfigServiceImpl
|
||||
});
|
||||
}
|
||||
|
||||
private createClient(port: string | number): SettingsServiceClient {
|
||||
// https://github.com/agreatfool/grpc_tools_node_protoc_ts/blob/master/doc/grpcjs_support.md#usage
|
||||
const SettingsServiceClient = grpc.makeClientConstructor(
|
||||
// @ts-expect-error: ignore
|
||||
serviceGrpcPb['cc.arduino.cli.settings.v1.SettingsService'],
|
||||
'SettingsServiceService'
|
||||
) as any;
|
||||
return new SettingsServiceClient(
|
||||
`localhost:${port}`,
|
||||
grpc.credentials.createInsecure()
|
||||
) as SettingsServiceClient;
|
||||
}
|
||||
|
||||
// #1445
|
||||
private async ensureUserDirExists(
|
||||
cliConfig: DefaultCliConfig
|
||||
|
||||
@@ -17,7 +17,6 @@ import {
|
||||
UpdateLibrariesIndexRequest,
|
||||
UpdateLibrariesIndexResponse,
|
||||
} from './cli-protocol/cc/arduino/cli/commands/v1/commands_pb';
|
||||
import * as commandsGrpcPb from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb';
|
||||
import {
|
||||
IndexType,
|
||||
IndexUpdateDidCompleteParams,
|
||||
@@ -43,6 +42,10 @@ import {
|
||||
} from './grpc-progressible';
|
||||
import type { DefaultCliConfig } from './cli-config';
|
||||
import { ServiceError } from './service-error';
|
||||
import {
|
||||
createArduinoCoreServiceClient,
|
||||
createDefaultChannelOptions,
|
||||
} from './arduino-core-service-client';
|
||||
|
||||
@injectable()
|
||||
export class CoreClientProvider {
|
||||
@@ -128,10 +131,9 @@ export class CoreClientProvider {
|
||||
/**
|
||||
* Encapsulates both the gRPC core client creation (`CreateRequest`) and initialization (`InitRequest`).
|
||||
*/
|
||||
private async create(port: string): Promise<CoreClientProvider.Client> {
|
||||
private async create(port: number): Promise<CoreClientProvider.Client> {
|
||||
this.closeClient();
|
||||
const address = this.address(port);
|
||||
const client = await this.createClient(address);
|
||||
const client = await this.createClient(port);
|
||||
this.toDisposeOnCloseClient.pushAll([
|
||||
Disposable.create(() => client.client.close()),
|
||||
]);
|
||||
@@ -195,22 +197,9 @@ export class CoreClientProvider {
|
||||
return this.toDisposeOnCloseClient.dispose();
|
||||
}
|
||||
|
||||
private async createClient(
|
||||
address: string
|
||||
): Promise<CoreClientProvider.Client> {
|
||||
// https://github.com/agreatfool/grpc_tools_node_protoc_ts/blob/master/doc/grpcjs_support.md#usage
|
||||
const ArduinoCoreServiceClient = grpc.makeClientConstructor(
|
||||
// @ts-expect-error: ignore
|
||||
commandsGrpcPb['cc.arduino.cli.commands.v1.ArduinoCoreService'],
|
||||
'ArduinoCoreServiceService'
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
) as any;
|
||||
const client = new ArduinoCoreServiceClient(
|
||||
address,
|
||||
grpc.credentials.createInsecure(),
|
||||
this.channelOptions
|
||||
) as ArduinoCoreServiceClient;
|
||||
|
||||
private async createClient(port: number): Promise<CoreClientProvider.Client> {
|
||||
const channelOptions = createDefaultChannelOptions(this.version);
|
||||
const client = createArduinoCoreServiceClient({ port, channelOptions });
|
||||
const instance = await new Promise<Instance>((resolve, reject) => {
|
||||
client.create(new CreateRequest(), (err, resp) => {
|
||||
if (err) {
|
||||
@@ -407,18 +396,6 @@ export class CoreClientProvider {
|
||||
});
|
||||
}
|
||||
|
||||
private address(port: string): string {
|
||||
return `localhost:${port}`;
|
||||
}
|
||||
|
||||
private get channelOptions(): Record<string, unknown> {
|
||||
return {
|
||||
'grpc.max_send_message_length': 512 * 1024 * 1024,
|
||||
'grpc.max_receive_message_length': 512 * 1024 * 1024,
|
||||
'grpc.primary_user_agent': `arduino-ide/${this.version}`,
|
||||
};
|
||||
}
|
||||
|
||||
private _version: string | undefined;
|
||||
private get version(): string {
|
||||
if (this._version) {
|
||||
|
||||
@@ -1,22 +1,44 @@
|
||||
import type { ClientReadableStream } from '@grpc/grpc-js';
|
||||
import { ApplicationError } from '@theia/core/lib/common/application-error';
|
||||
import type { CancellationToken } from '@theia/core/lib/common/cancellation';
|
||||
import { CommandService } from '@theia/core/lib/common/command';
|
||||
import {
|
||||
Disposable,
|
||||
DisposableCollection,
|
||||
} from '@theia/core/lib/common/disposable';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import type { Mutable } from '@theia/core/lib/common/types';
|
||||
import { FileUri } from '@theia/core/lib/node/file-uri';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import { relative } from 'node:path';
|
||||
import * as jspb from 'google-protobuf';
|
||||
import { BoolValue } from 'google-protobuf/google/protobuf/wrappers_pb';
|
||||
import type { ClientReadableStream } from '@grpc/grpc-js';
|
||||
import path from 'node:path';
|
||||
import {
|
||||
UploadResponse as ApiUploadResponse,
|
||||
OutputMessage,
|
||||
Port,
|
||||
PortIdentifier,
|
||||
resolveDetectedPort,
|
||||
} from '../common/protocol';
|
||||
import {
|
||||
CompilerWarnings,
|
||||
CoreService,
|
||||
CoreError,
|
||||
CompileSummary,
|
||||
CompilerWarnings,
|
||||
CoreError,
|
||||
CoreService,
|
||||
isCompileSummary,
|
||||
isUploadResponse,
|
||||
} from '../common/protocol/core-service';
|
||||
import { ResponseService } from '../common/protocol/response-service';
|
||||
import { firstToUpperCase, notEmpty } from '../common/utils';
|
||||
import { BoardDiscovery, createApiPort } from './board-discovery';
|
||||
import { tryParseError } from './cli-error-parser';
|
||||
import { ArduinoCoreServiceClient } from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb';
|
||||
import { Instance } from './cli-protocol/cc/arduino/cli/commands/v1/common_pb';
|
||||
import {
|
||||
CompileRequest,
|
||||
CompileResponse,
|
||||
} from './cli-protocol/cc/arduino/cli/commands/v1/compile_pb';
|
||||
import { CoreClientAware } from './core-client-provider';
|
||||
import { Port as RpcPort } from './cli-protocol/cc/arduino/cli/commands/v1/port_pb';
|
||||
import {
|
||||
BurnBootloaderRequest,
|
||||
BurnBootloaderResponse,
|
||||
@@ -25,26 +47,13 @@ import {
|
||||
UploadUsingProgrammerRequest,
|
||||
UploadUsingProgrammerResponse,
|
||||
} from './cli-protocol/cc/arduino/cli/commands/v1/upload_pb';
|
||||
import { ResponseService } from '../common/protocol/response-service';
|
||||
import {
|
||||
resolveDetectedPort,
|
||||
OutputMessage,
|
||||
PortIdentifier,
|
||||
Port,
|
||||
UploadResponse as ApiUploadResponse,
|
||||
} from '../common/protocol';
|
||||
import { ArduinoCoreServiceClient } from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb';
|
||||
import { Port as RpcPort } from './cli-protocol/cc/arduino/cli/commands/v1/port_pb';
|
||||
import { ApplicationError, CommandService, Disposable, nls } from '@theia/core';
|
||||
import { MonitorManager } from './monitor-manager';
|
||||
import { AutoFlushingBuffer } from './utils/buffers';
|
||||
import { tryParseError } from './cli-error-parser';
|
||||
import { Instance } from './cli-protocol/cc/arduino/cli/commands/v1/common_pb';
|
||||
import { firstToUpperCase, notEmpty } from '../common/utils';
|
||||
import { ServiceError } from './service-error';
|
||||
import { CoreClientAware } from './core-client-provider';
|
||||
import { ExecuteWithProgress, ProgressResponse } from './grpc-progressible';
|
||||
import type { Mutable } from '@theia/core/lib/common/types';
|
||||
import { BoardDiscovery, createApiPort } from './board-discovery';
|
||||
import { MonitorManager } from './monitor-manager';
|
||||
import { ServiceError } from './service-error';
|
||||
import { AutoFlushingBuffer } from './utils/buffers';
|
||||
import { userAbort } from '../common/nls';
|
||||
import { UserAbortApplicationError } from '../common/protocol/progressible';
|
||||
|
||||
namespace Uploadable {
|
||||
export type Request = UploadRequest | UploadUsingProgrammerRequest;
|
||||
@@ -64,9 +73,13 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||
@inject(BoardDiscovery)
|
||||
private readonly boardDiscovery: BoardDiscovery;
|
||||
|
||||
async compile(options: CoreService.Options.Compile): Promise<void> {
|
||||
async compile(
|
||||
options: CoreService.Options.Compile,
|
||||
cancellationToken?: CancellationToken
|
||||
): Promise<void> {
|
||||
const coreClient = await this.coreClient;
|
||||
const { client, instance } = coreClient;
|
||||
const request = this.compileRequest(options, instance);
|
||||
const compileSummary = <CompileSummaryFragment>{};
|
||||
const progressHandler = this.createProgressHandler(options);
|
||||
const compileSummaryHandler = (response: CompileResponse) =>
|
||||
@@ -75,10 +88,15 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||
progressHandler,
|
||||
compileSummaryHandler
|
||||
);
|
||||
const request = this.compileRequest(options, instance);
|
||||
const toDisposeOnFinally = new DisposableCollection(handler);
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
client
|
||||
.compile(request)
|
||||
const call = client.compile(request);
|
||||
if (cancellationToken) {
|
||||
toDisposeOnFinally.push(
|
||||
cancellationToken.onCancellationRequested(() => call.cancel())
|
||||
);
|
||||
}
|
||||
call
|
||||
.on('data', handler.onData)
|
||||
.on('error', (error) => {
|
||||
if (!ServiceError.is(error)) {
|
||||
@@ -87,30 +105,39 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||
error
|
||||
);
|
||||
reject(error);
|
||||
} else {
|
||||
const compilerErrors = tryParseError({
|
||||
content: handler.content,
|
||||
sketch: options.sketch,
|
||||
});
|
||||
const message = nls.localize(
|
||||
'arduino/compile/error',
|
||||
'Compilation error: {0}',
|
||||
compilerErrors
|
||||
.map(({ message }) => message)
|
||||
.filter(notEmpty)
|
||||
.shift() ?? error.details
|
||||
);
|
||||
this.sendResponse(
|
||||
error.details + '\n\n' + message,
|
||||
OutputMessage.Severity.Error
|
||||
);
|
||||
reject(CoreError.VerifyFailed(message, compilerErrors));
|
||||
return;
|
||||
}
|
||||
if (ServiceError.isCancel(error)) {
|
||||
console.log(userAbort);
|
||||
reject(UserAbortApplicationError());
|
||||
return;
|
||||
}
|
||||
const compilerErrors = tryParseError({
|
||||
content: handler.content,
|
||||
sketch: options.sketch,
|
||||
});
|
||||
const message = nls.localize(
|
||||
'arduino/compile/error',
|
||||
'Compilation error: {0}',
|
||||
compilerErrors
|
||||
.map(({ message }) => message)
|
||||
.filter(notEmpty)
|
||||
.shift() ?? error.details
|
||||
);
|
||||
this.sendResponse(
|
||||
error.details + '\n\n' + message,
|
||||
OutputMessage.Severity.Error
|
||||
);
|
||||
reject(CoreError.VerifyFailed(message, compilerErrors));
|
||||
})
|
||||
.on('end', resolve);
|
||||
}).finally(() => {
|
||||
handler.dispose();
|
||||
toDisposeOnFinally.dispose();
|
||||
if (!isCompileSummary(compileSummary)) {
|
||||
if (cancellationToken && cancellationToken.isCancellationRequested) {
|
||||
// NOOP
|
||||
return;
|
||||
}
|
||||
console.error(
|
||||
`Have not received the full compile summary from the CLI while running the compilation. ${JSON.stringify(
|
||||
compileSummary
|
||||
@@ -176,7 +203,10 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||
return request;
|
||||
}
|
||||
|
||||
upload(options: CoreService.Options.Upload): Promise<ApiUploadResponse> {
|
||||
upload(
|
||||
options: CoreService.Options.Upload,
|
||||
cancellationToken?: CancellationToken
|
||||
): Promise<ApiUploadResponse> {
|
||||
const { usingProgrammer } = options;
|
||||
return this.doUpload(
|
||||
options,
|
||||
@@ -190,7 +220,8 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||
usingProgrammer
|
||||
? CoreError.UploadUsingProgrammerFailed
|
||||
: CoreError.UploadFailed,
|
||||
`upload${usingProgrammer ? ' using programmer' : ''}`
|
||||
`upload${usingProgrammer ? ' using programmer' : ''}`,
|
||||
cancellationToken
|
||||
);
|
||||
}
|
||||
|
||||
@@ -204,7 +235,8 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||
client: ArduinoCoreServiceClient
|
||||
) => (request: REQ) => ClientReadableStream<RESP>,
|
||||
errorCtor: ApplicationError.Constructor<number, CoreError.ErrorLocation[]>,
|
||||
task: string
|
||||
task: string,
|
||||
cancellationToken?: CancellationToken
|
||||
): Promise<ApiUploadResponse> {
|
||||
const portBeforeUpload = options.port;
|
||||
const uploadResponseFragment: Mutable<Partial<ApiUploadResponse>> = {
|
||||
@@ -241,33 +273,47 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||
progressHandler,
|
||||
updateUploadResponseFragmentHandler
|
||||
);
|
||||
const toDisposeOnFinally = new DisposableCollection(handler);
|
||||
const grpcCall = responseFactory(client);
|
||||
return this.notifyUploadWillStart(options).then(() =>
|
||||
new Promise<ApiUploadResponse>((resolve, reject) => {
|
||||
grpcCall(this.initUploadRequest(request, options, instance))
|
||||
const call = grpcCall(
|
||||
this.initUploadRequest(request, options, instance)
|
||||
);
|
||||
if (cancellationToken) {
|
||||
toDisposeOnFinally.push(
|
||||
cancellationToken.onCancellationRequested(() => call.cancel())
|
||||
);
|
||||
}
|
||||
call
|
||||
.on('data', handler.onData)
|
||||
.on('error', (error) => {
|
||||
if (!ServiceError.is(error)) {
|
||||
console.error(`Unexpected error occurred while ${task}.`, error);
|
||||
reject(error);
|
||||
} else {
|
||||
const message = nls.localize(
|
||||
'arduino/upload/error',
|
||||
'{0} error: {1}',
|
||||
firstToUpperCase(task),
|
||||
error.details
|
||||
);
|
||||
this.sendResponse(error.details, OutputMessage.Severity.Error);
|
||||
reject(
|
||||
errorCtor(
|
||||
message,
|
||||
tryParseError({
|
||||
content: handler.content,
|
||||
sketch: options.sketch,
|
||||
})
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (ServiceError.isCancel(error)) {
|
||||
console.log(userAbort);
|
||||
reject(UserAbortApplicationError());
|
||||
return;
|
||||
}
|
||||
const message = nls.localize(
|
||||
'arduino/upload/error',
|
||||
'{0} error: {1}',
|
||||
firstToUpperCase(task),
|
||||
error.details
|
||||
);
|
||||
this.sendResponse(error.details, OutputMessage.Severity.Error);
|
||||
reject(
|
||||
errorCtor(
|
||||
message,
|
||||
tryParseError({
|
||||
content: handler.content,
|
||||
sketch: options.sketch,
|
||||
})
|
||||
)
|
||||
);
|
||||
})
|
||||
.on('end', () => {
|
||||
if (isUploadResponse(uploadResponseFragment)) {
|
||||
@@ -285,7 +331,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||
}
|
||||
});
|
||||
}).finally(async () => {
|
||||
handler.dispose();
|
||||
toDisposeOnFinally.dispose();
|
||||
await this.notifyUploadDidFinish(
|
||||
Object.assign(options, {
|
||||
afterPort: uploadResponseFragment.portAfterUpload,
|
||||
@@ -320,16 +366,25 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||
return request;
|
||||
}
|
||||
|
||||
async burnBootloader(options: CoreService.Options.Bootloader): Promise<void> {
|
||||
async burnBootloader(
|
||||
options: CoreService.Options.Bootloader,
|
||||
cancellationToken?: CancellationToken
|
||||
): Promise<void> {
|
||||
const coreClient = await this.coreClient;
|
||||
const { client, instance } = coreClient;
|
||||
const progressHandler = this.createProgressHandler(options);
|
||||
const handler = this.createOnDataHandler(progressHandler);
|
||||
const request = this.burnBootloaderRequest(options, instance);
|
||||
const toDisposeOnFinally = new DisposableCollection(handler);
|
||||
return this.notifyUploadWillStart(options).then(() =>
|
||||
new Promise<void>((resolve, reject) => {
|
||||
client
|
||||
.burnBootloader(request)
|
||||
const call = client.burnBootloader(request);
|
||||
if (cancellationToken) {
|
||||
toDisposeOnFinally.push(
|
||||
cancellationToken.onCancellationRequested(() => call.cancel())
|
||||
);
|
||||
}
|
||||
call
|
||||
.on('data', handler.onData)
|
||||
.on('error', (error) => {
|
||||
if (!ServiceError.is(error)) {
|
||||
@@ -338,23 +393,28 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||
error
|
||||
);
|
||||
reject(error);
|
||||
} else {
|
||||
this.sendResponse(error.details, OutputMessage.Severity.Error);
|
||||
reject(
|
||||
CoreError.BurnBootloaderFailed(
|
||||
nls.localize(
|
||||
'arduino/burnBootloader/error',
|
||||
'Error while burning the bootloader: {0}',
|
||||
error.details
|
||||
),
|
||||
tryParseError({ content: handler.content })
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (ServiceError.isCancel(error)) {
|
||||
console.log(userAbort);
|
||||
reject(UserAbortApplicationError());
|
||||
return;
|
||||
}
|
||||
this.sendResponse(error.details, OutputMessage.Severity.Error);
|
||||
reject(
|
||||
CoreError.BurnBootloaderFailed(
|
||||
nls.localize(
|
||||
'arduino/burnBootloader/error',
|
||||
'Error while burning the bootloader: {0}',
|
||||
error.details
|
||||
),
|
||||
tryParseError({ content: handler.content })
|
||||
)
|
||||
);
|
||||
})
|
||||
.on('end', resolve);
|
||||
}).finally(async () => {
|
||||
handler.dispose();
|
||||
toDisposeOnFinally.dispose();
|
||||
await this.notifyUploadDidFinish(
|
||||
Object.assign(options, { afterPort: options.port })
|
||||
);
|
||||
@@ -463,7 +523,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||
for (const uri of Object.keys(options.sourceOverride)) {
|
||||
const content = options.sourceOverride[uri];
|
||||
if (content) {
|
||||
const relativePath = relative(sketchPath, FileUri.fsPath(uri));
|
||||
const relativePath = path.relative(sketchPath, FileUri.fsPath(uri));
|
||||
req.getSourceOverrideMap().set(relativePath, content);
|
||||
}
|
||||
}
|
||||
@@ -535,18 +595,31 @@ function updateCompileSummary(
|
||||
compileSummary: CompileSummaryFragment,
|
||||
response: CompileResponse
|
||||
): CompileSummaryFragment {
|
||||
const buildPath = response.getBuildPath();
|
||||
const messageCase = response.getMessageCase();
|
||||
if (messageCase !== CompileResponse.MessageCase.RESULT) {
|
||||
return compileSummary;
|
||||
}
|
||||
const result = response.getResult();
|
||||
if (!result) {
|
||||
console.warn(
|
||||
`Build result is missing from response: ${JSON.stringify(
|
||||
response.toObject(false)
|
||||
)}`
|
||||
);
|
||||
return compileSummary;
|
||||
}
|
||||
const buildPath = result.getBuildPath();
|
||||
if (buildPath) {
|
||||
compileSummary.buildPath = buildPath;
|
||||
compileSummary.buildOutputUri = FileUri.create(buildPath).toString();
|
||||
}
|
||||
const executableSectionsSize = response.getExecutableSectionsSizeList();
|
||||
const executableSectionsSize = result.getExecutableSectionsSizeList();
|
||||
if (executableSectionsSize) {
|
||||
compileSummary.executableSectionsSize = executableSectionsSize.map((item) =>
|
||||
item.toObject(false)
|
||||
);
|
||||
}
|
||||
const usedLibraries = response.getUsedLibrariesList();
|
||||
const usedLibraries = result.getUsedLibrariesList();
|
||||
if (usedLibraries) {
|
||||
compileSummary.usedLibraries = usedLibraries.map((item) => {
|
||||
const object = item.toObject(false);
|
||||
@@ -575,15 +648,15 @@ function updateCompileSummary(
|
||||
return library;
|
||||
});
|
||||
}
|
||||
const boardPlatform = response.getBoardPlatform();
|
||||
const boardPlatform = result.getBoardPlatform();
|
||||
if (boardPlatform) {
|
||||
compileSummary.buildPlatform = boardPlatform.toObject(false);
|
||||
}
|
||||
const buildPlatform = response.getBuildPlatform();
|
||||
const buildPlatform = result.getBuildPlatform();
|
||||
if (buildPlatform) {
|
||||
compileSummary.buildPlatform = buildPlatform.toObject(false);
|
||||
}
|
||||
const buildProperties = response.getBuildPropertiesList();
|
||||
const buildProperties = result.getBuildPropertiesList();
|
||||
if (buildProperties) {
|
||||
compileSummary.buildProperties = buildProperties.slice();
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ export class LibraryServiceImpl
|
||||
}
|
||||
|
||||
const req = new LibrarySearchRequest();
|
||||
req.setQuery(options.query || '');
|
||||
req.setSearchArgs(options.query || '');
|
||||
req.setInstance(instance);
|
||||
req.setOmitReleasesDetails(true);
|
||||
const resp = await new Promise<LibrarySearchResponse>((resolve, reject) =>
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
EnumerateMonitorPortSettingsRequest,
|
||||
EnumerateMonitorPortSettingsResponse,
|
||||
MonitorPortConfiguration,
|
||||
MonitorPortOpenRequest,
|
||||
MonitorPortSetting,
|
||||
MonitorRequest,
|
||||
MonitorResponse,
|
||||
@@ -229,16 +230,16 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
||||
const coreClient = await this.coreClient;
|
||||
|
||||
const { instance } = coreClient;
|
||||
const monitorRequest = new MonitorRequest();
|
||||
monitorRequest.setInstance(instance);
|
||||
const openPortRequest = new MonitorPortOpenRequest();
|
||||
openPortRequest.setInstance(instance);
|
||||
if (this.board?.fqbn) {
|
||||
monitorRequest.setFqbn(this.board.fqbn);
|
||||
openPortRequest.setFqbn(this.board.fqbn);
|
||||
}
|
||||
if (this.port?.address && this.port?.protocol) {
|
||||
const rpcPort = new RpcPort();
|
||||
rpcPort.setAddress(this.port.address);
|
||||
rpcPort.setProtocol(this.port.protocol);
|
||||
monitorRequest.setPort(rpcPort);
|
||||
openPortRequest.setPort(rpcPort);
|
||||
}
|
||||
const config = new MonitorPortConfiguration();
|
||||
for (const id in this.settings.pluggableMonitorSettings) {
|
||||
@@ -247,9 +248,9 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
||||
s.setValue(this.settings.pluggableMonitorSettings[id].selectedValue);
|
||||
config.addSettings(s);
|
||||
}
|
||||
monitorRequest.setPortConfiguration(config);
|
||||
openPortRequest.setPortConfiguration(config);
|
||||
|
||||
await this.pollWriteToStream(monitorRequest);
|
||||
await this.pollWriteToStream(openPortRequest);
|
||||
// Only store the config, if the monitor has successfully started.
|
||||
this.currentPortConfigSnapshot = MonitorPortConfiguration.toObject(
|
||||
false,
|
||||
@@ -344,7 +345,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
pollWriteToStream(request: MonitorRequest): Promise<void> {
|
||||
pollWriteToStream(request: MonitorPortOpenRequest): Promise<void> {
|
||||
const createWriteToStreamExecutor =
|
||||
(duplex: ClientDuplexStream<MonitorRequest, MonitorResponse>) =>
|
||||
(resolve: () => void, reject: (reason?: unknown) => void) => {
|
||||
@@ -380,7 +381,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
||||
];
|
||||
|
||||
this.setDuplexHandlers(duplex, resolvingDuplexHandlers);
|
||||
duplex.write(request);
|
||||
duplex.write(new MonitorRequest().setOpenRequest(request));
|
||||
};
|
||||
|
||||
return Promise.race([
|
||||
@@ -409,6 +410,8 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
||||
]) as Promise<unknown> as Promise<void>;
|
||||
}
|
||||
|
||||
private endingDuplex: Promise<void> | undefined;
|
||||
|
||||
/**
|
||||
* Pauses the currently running monitor, it still closes the gRPC connection
|
||||
* with the underlying monitor process but it doesn't stop the message handlers
|
||||
@@ -418,29 +421,43 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
||||
* @returns
|
||||
*/
|
||||
async pause(): Promise<void> {
|
||||
return new Promise(async (resolve) => {
|
||||
if (!this.duplex) {
|
||||
this.logger.warn(
|
||||
`monitor to ${this.port?.address} using ${this.port?.protocol} already stopped`
|
||||
);
|
||||
return resolve();
|
||||
}
|
||||
// It's enough to close the connection with the client
|
||||
// to stop the monitor process
|
||||
this.duplex.end();
|
||||
this.logger.info(
|
||||
`stopped monitor to ${this.port?.address} using ${this.port?.protocol}`
|
||||
const duplex = this.duplex;
|
||||
if (!duplex) {
|
||||
this.logger.warn(
|
||||
`monitor to ${this.port?.address} using ${this.port?.protocol} already stopped`
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (this.endingDuplex) {
|
||||
return this.endingDuplex;
|
||||
}
|
||||
const deferredEnd = new Deferred<void>();
|
||||
this.endingDuplex = deferredEnd.promise;
|
||||
|
||||
this.duplex.on('end', resolve);
|
||||
// to terminate the monitor connection, send a close request, and wait for the end event
|
||||
duplex.once('end', () => {
|
||||
deferredEnd.resolve();
|
||||
});
|
||||
try {
|
||||
await new Promise((resolve) =>
|
||||
duplex.write(new MonitorRequest().setClose(true), resolve)
|
||||
);
|
||||
await this.endingDuplex;
|
||||
} finally {
|
||||
this.endingDuplex = undefined;
|
||||
}
|
||||
// Sanity check
|
||||
// Duplexes are allowed to be half open, check whether the monitor server (the readable) has ended
|
||||
if (!duplex.readableEnded) {
|
||||
throw new Error('Could not end the monitor connection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the monitor currently running
|
||||
*/
|
||||
async stop(): Promise<void> {
|
||||
return this.pause().finally(this.stopMessagesHandlers.bind(this));
|
||||
return this.pause().finally(() => this.stopMessagesHandlers());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -454,11 +471,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
||||
if (!this.duplex) {
|
||||
throw createNotConnectedError(this.port);
|
||||
}
|
||||
const coreClient = await this.coreClient;
|
||||
const { instance } = coreClient;
|
||||
|
||||
const req = new MonitorRequest();
|
||||
req.setInstance(instance);
|
||||
req.setTxData(new TextEncoder().encode(message));
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
if (this.duplex) {
|
||||
@@ -588,17 +601,13 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
||||
return;
|
||||
}
|
||||
|
||||
const coreClient = await this.coreClient;
|
||||
const { instance } = coreClient;
|
||||
|
||||
this.logger.info(
|
||||
`Sending monitor request with new port configuration: ${JSON.stringify(
|
||||
MonitorPortConfiguration.toObject(false, diffConfig)
|
||||
)}`
|
||||
);
|
||||
const req = new MonitorRequest();
|
||||
req.setInstance(instance);
|
||||
req.setPortConfiguration(diffConfig);
|
||||
req.setUpdatedConfiguration(diffConfig);
|
||||
this.duplex.write(req);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export class NotificationServiceServerImpl
|
||||
this.clients.forEach((client) => client.notifyIndexUpdateDidFail(params));
|
||||
}
|
||||
|
||||
notifyDaemonDidStart(port: string): void {
|
||||
notifyDaemonDidStart(port: number): void {
|
||||
this.clients.forEach((client) => client.notifyDaemonDidStart(port));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,48 +1,55 @@
|
||||
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
||||
import { promises as fs, realpath, lstat, Stats, constants } from 'node:fs';
|
||||
import os from 'node:os';
|
||||
import temp from 'temp';
|
||||
import path from 'node:path';
|
||||
import glob from 'glob';
|
||||
import crypto from 'node:crypto';
|
||||
import PQueue from 'p-queue';
|
||||
import type { Mutable } from '@theia/core/lib/common/types';
|
||||
import URI from '@theia/core/lib/common/uri';
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
import { FileUri } from '@theia/core/lib/node/file-uri';
|
||||
import { ConfigServiceImpl } from './config-service-impl';
|
||||
import {
|
||||
SketchesService,
|
||||
Sketch,
|
||||
SketchRef,
|
||||
SketchContainer,
|
||||
SketchesError,
|
||||
} from '../common/protocol/sketches-service';
|
||||
import { NotificationServiceServer } from '../common/protocol';
|
||||
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
||||
import { CoreClientAware } from './core-client-provider';
|
||||
import {
|
||||
ArchiveSketchRequest,
|
||||
LoadSketchRequest,
|
||||
} from './cli-protocol/cc/arduino/cli/commands/v1/commands_pb';
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import { isWindows } from '@theia/core/lib/common/os';
|
||||
import { Deferred } from '@theia/core/lib/common/promise-util';
|
||||
import { escapeRegExpCharacters } from '@theia/core/lib/common/strings';
|
||||
import { ServiceError } from './service-error';
|
||||
import type { Mutable } from '@theia/core/lib/common/types';
|
||||
import URI from '@theia/core/lib/common/uri';
|
||||
import { FileUri } from '@theia/core/lib/node/file-uri';
|
||||
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
||||
import glob from 'glob';
|
||||
import crypto from 'node:crypto';
|
||||
import {
|
||||
IsTempSketch,
|
||||
maybeNormalizeDrive,
|
||||
TempSketchPrefix,
|
||||
Win32DriveRegex,
|
||||
} from './is-temp-sketch';
|
||||
import { join } from 'node:path';
|
||||
import { ErrnoException } from './utils/errors';
|
||||
import { isWindows } from '@theia/core/lib/common/os';
|
||||
CopyOptions,
|
||||
Stats,
|
||||
constants,
|
||||
promises as fs,
|
||||
lstat,
|
||||
realpath,
|
||||
} from 'node:fs';
|
||||
import os from 'node:os';
|
||||
import path, { join } from 'node:path';
|
||||
import PQueue from 'p-queue';
|
||||
import temp from 'temp';
|
||||
import { NotificationServiceServer } from '../common/protocol';
|
||||
import {
|
||||
Sketch,
|
||||
SketchContainer,
|
||||
SketchRef,
|
||||
SketchesError,
|
||||
SketchesService,
|
||||
} from '../common/protocol/sketches-service';
|
||||
import {
|
||||
firstToLowerCase,
|
||||
firstToUpperCase,
|
||||
startsWithUpperCase,
|
||||
} from '../common/utils';
|
||||
import {
|
||||
ArchiveSketchRequest,
|
||||
LoadSketchRequest,
|
||||
} from './cli-protocol/cc/arduino/cli/commands/v1/commands_pb';
|
||||
import { ConfigServiceImpl } from './config-service-impl';
|
||||
import { CoreClientAware } from './core-client-provider';
|
||||
import {
|
||||
IsTempSketch,
|
||||
TempSketchPrefix,
|
||||
Win32DriveRegex,
|
||||
maybeNormalizeDrive,
|
||||
} from './is-temp-sketch';
|
||||
import { ServiceError } from './service-error';
|
||||
import { SettingsReader } from './settings-reader';
|
||||
import { ErrnoException } from './utils/errors';
|
||||
|
||||
const RecentSketches = 'recent-sketches.json';
|
||||
const DefaultIno = `void setup() {
|
||||
@@ -160,7 +167,16 @@ export class SketchesServiceImpl
|
||||
reject(rejectWith);
|
||||
return;
|
||||
}
|
||||
const responseSketchPath = maybeNormalizeDrive(resp.getLocationPath());
|
||||
const sketch = resp.getSketch();
|
||||
if (!sketch) {
|
||||
reject(
|
||||
new Error(`Incomplete LoadSketch response. Sketch is missing.`)
|
||||
);
|
||||
return;
|
||||
}
|
||||
const responseSketchPath = maybeNormalizeDrive(
|
||||
sketch.getLocationPath()
|
||||
);
|
||||
if (requestSketchPath !== responseSketchPath) {
|
||||
this.logger.warn(
|
||||
`Warning! The request sketch path was different than the response sketch path from the CLI. This could be a potential bug. Request: <${requestSketchPath}>, response: <${responseSketchPath}>.`
|
||||
@@ -178,14 +194,14 @@ export class SketchesServiceImpl
|
||||
resolve({
|
||||
name: path.basename(responseSketchPath),
|
||||
uri: FileUri.create(responseSketchPath).toString(),
|
||||
mainFileUri: FileUri.create(resp.getMainFile()).toString(),
|
||||
otherSketchFileUris: resp
|
||||
mainFileUri: FileUri.create(sketch.getMainFile()).toString(),
|
||||
otherSketchFileUris: sketch
|
||||
.getOtherSketchFilesList()
|
||||
.map((p) => FileUri.create(p).toString()),
|
||||
additionalFileUris: resp
|
||||
additionalFileUris: sketch
|
||||
.getAdditionalFilesList()
|
||||
.map((p) => FileUri.create(p).toString()),
|
||||
rootFolderFileUris: resp
|
||||
rootFolderFileUris: sketch
|
||||
.getRootFolderFilesList()
|
||||
.map((p) => FileUri.create(p).toString()),
|
||||
mtimeMs,
|
||||
@@ -510,26 +526,108 @@ export class SketchesServiceImpl
|
||||
}
|
||||
const sourceFolderBasename = path.basename(source);
|
||||
const destinationFolderBasename = path.basename(destination);
|
||||
let filter;
|
||||
|
||||
const errorMessage = Sketch.validateSketchFolderName(
|
||||
destinationFolderBasename
|
||||
);
|
||||
if (errorMessage) {
|
||||
const message = `${nls.localize(
|
||||
'arduino/sketch/invalidSketchFolderNameMessage',
|
||||
"Invalid sketch folder name: '{0}'",
|
||||
destinationFolderBasename
|
||||
)} ${errorMessage}`;
|
||||
throw SketchesError.InvalidFolderName(message, destinationFolderBasename);
|
||||
}
|
||||
|
||||
// verify a possible name collision with existing ino files
|
||||
if (sourceFolderBasename !== destinationFolderBasename) {
|
||||
try {
|
||||
const otherInoBasename = `${destinationFolderBasename}.ino`;
|
||||
const otherInoPath = join(source, otherInoBasename);
|
||||
const stat = await fs.stat(otherInoPath);
|
||||
if (stat.isFile()) {
|
||||
const message = nls.localize(
|
||||
'arduino/sketch/sketchAlreadyContainsThisFileError',
|
||||
"The sketch already contains a file named '{0}'",
|
||||
otherInoBasename
|
||||
);
|
||||
// if can read the file, it will be a collision
|
||||
throw SketchesError.SketchAlreadyContainsThisFile(
|
||||
message,
|
||||
sourceFolderBasename,
|
||||
destinationFolderBasename,
|
||||
otherInoBasename
|
||||
);
|
||||
}
|
||||
// Otherwise, it's OK, if it is an existing directory
|
||||
} catch (err) {
|
||||
// It's OK if the file is missing.
|
||||
if (!ErrnoException.isENOENT(err)) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let filter: CopyOptions['filter'];
|
||||
if (onlySketchFiles) {
|
||||
const sketchFilePaths = Sketch.uris(sketch).map(FileUri.fsPath);
|
||||
filter = (file: { path: string }) => sketchFilePaths.includes(file.path);
|
||||
// The Windows paths, can be a trash (see below). Hence, it must be resolved with Node.js.
|
||||
// After resolving the path, the drive letter is still a gamble (can be upper or lower case) and could result in a false negative match.
|
||||
// Here, all sketch file paths must be resolved by Node.js, to provide the same drive letter casing.
|
||||
const sketchFilePaths = await Promise.all(
|
||||
Sketch.uris(sketch)
|
||||
.map(FileUri.fsPath)
|
||||
.map((path) => fs.realpath(path))
|
||||
);
|
||||
filter = async (s) => {
|
||||
// On Windows, the source path could start with a complete trash. For example, \\\\?\\c:\\Users\\kittaakos\\AppData\\Local\\Temp\\.arduinoIDE-unsaved20231024-9300-1hp64fi.g8yh\\sketch_nov24d.
|
||||
// The path must be resolved.
|
||||
const resolvedSource = await fs.realpath(s);
|
||||
if (sketchFilePaths.includes(resolvedSource)) {
|
||||
return true;
|
||||
}
|
||||
const stat = await fs.stat(resolvedSource);
|
||||
if (stat.isFile()) {
|
||||
return false;
|
||||
}
|
||||
// Copy the folder if any of the sketch file path starts with this folder
|
||||
return sketchFilePaths.some((sketchFilePath) =>
|
||||
sketchFilePath.startsWith(resolvedSource)
|
||||
);
|
||||
};
|
||||
} else {
|
||||
filter = () => true;
|
||||
}
|
||||
const cpyModule = await import('cpy');
|
||||
const cpy = cpyModule.default;
|
||||
await cpy(sourceFolderBasename, destination, {
|
||||
rename: (basename) =>
|
||||
sourceFolderBasename !== destinationFolderBasename &&
|
||||
basename === `${sourceFolderBasename}.ino`
|
||||
? `${destinationFolderBasename}.ino`
|
||||
: basename,
|
||||
|
||||
const tempRoot = await this.createTempFolder();
|
||||
const temp = join(tempRoot, destinationFolderBasename);
|
||||
await fs.mkdir(temp, { recursive: true });
|
||||
|
||||
// copy to temp folder
|
||||
await fs.cp(source, temp, {
|
||||
filter,
|
||||
cwd: path.dirname(source),
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
const copiedSketch = await this.doLoadSketch(destinationUri, false);
|
||||
return copiedSketch;
|
||||
|
||||
const sourceMainSketchFilePath = FileUri.fsPath(sketch.mainFileUri);
|
||||
// Can copy sketch with pde main sketch file: https://github.com/arduino/arduino-ide/issues/2377
|
||||
const ext = path.extname(sourceMainSketchFilePath);
|
||||
|
||||
// rename the main sketch file
|
||||
await fs.rename(
|
||||
join(temp, `${sourceFolderBasename}${ext}`),
|
||||
join(temp, `${destinationFolderBasename}.ino`)
|
||||
);
|
||||
|
||||
// copy to destination
|
||||
try {
|
||||
await fs.cp(temp, destination, { recursive: true, force: true });
|
||||
const copiedSketch = await this.doLoadSketch(destinationUri, false);
|
||||
return copiedSketch;
|
||||
} finally {
|
||||
// remove temp
|
||||
fs.rm(tempRoot, { recursive: true, force: true, maxRetries: 5 }); // no await
|
||||
}
|
||||
}
|
||||
|
||||
async archive(sketch: Sketch, destinationUri: string): Promise<string> {
|
||||
|
||||
@@ -170,6 +170,36 @@ describe('board-service-provider', () => {
|
||||
expect(events).deep.equals([expectedEvent]);
|
||||
});
|
||||
|
||||
it('should ignore custom board configs from the FQBN', () => {
|
||||
boardsServiceProvider['_boardsConfig'] = {
|
||||
selectedBoard: uno,
|
||||
selectedPort: unoSerialPort,
|
||||
};
|
||||
const events: BoardsConfigChangeEvent[] = [];
|
||||
toDisposeAfterEach.push(
|
||||
boardsServiceProvider.onBoardsConfigDidChange((event) =>
|
||||
events.push(event)
|
||||
)
|
||||
);
|
||||
const mkr1000WithCustomOptions = {
|
||||
...mkr1000,
|
||||
fqbn: `${mkr1000.fqbn}:c1=v1`,
|
||||
};
|
||||
const didUpdate = boardsServiceProvider.updateConfig(
|
||||
mkr1000WithCustomOptions
|
||||
);
|
||||
expect(didUpdate).to.be.true;
|
||||
const expectedEvent: BoardIdentifierChangeEvent = {
|
||||
previousSelectedBoard: uno,
|
||||
selectedBoard: mkr1000WithCustomOptions, // the even has the custom board options
|
||||
};
|
||||
expect(events).deep.equals([expectedEvent]);
|
||||
// the persisted state does not have the config options property
|
||||
expect(boardsServiceProvider.boardsConfig.selectedBoard?.fqbn).to.equal(
|
||||
mkr1000.fqbn
|
||||
);
|
||||
});
|
||||
|
||||
it('should not update the board if did not change (board identifier)', () => {
|
||||
boardsServiceProvider['_boardsConfig'] = {
|
||||
selectedBoard: uno,
|
||||
|
||||
@@ -15,11 +15,14 @@ import {
|
||||
DisposableCollection,
|
||||
} from '@theia/core/lib/common/disposable';
|
||||
import { MessageService } from '@theia/core/lib/common/message-service';
|
||||
import { wait } from '@theia/core/lib/common/promise-util';
|
||||
import { wait, waitForEvent } from '@theia/core/lib/common/promise-util';
|
||||
import { Container, ContainerModule } from '@theia/core/shared/inversify';
|
||||
import { expect } from 'chai';
|
||||
import { BoardsDataStore } from '../../browser/boards/boards-data-store';
|
||||
import { BoardsServiceProvider } from '../../browser/boards/boards-service-provider';
|
||||
import {
|
||||
BoardsServiceProvider,
|
||||
UpdateBoardsConfigParams,
|
||||
} from '../../browser/boards/boards-service-provider';
|
||||
import { NotificationCenter } from '../../browser/notification-center';
|
||||
import {
|
||||
BoardDetails,
|
||||
@@ -30,6 +33,7 @@ import {
|
||||
} from '../../common/protocol/boards-service';
|
||||
import { NotificationServiceServer } from '../../common/protocol/notification-service';
|
||||
import { bindBrowser } from './browser-test-bindings';
|
||||
import { unoSerialPort } from '../common/fixtures';
|
||||
|
||||
disableJSDOM();
|
||||
|
||||
@@ -256,8 +260,12 @@ describe('boards-data-store', function () {
|
||||
|
||||
const result = await boardsDataStore.selectConfigOption({
|
||||
fqbn,
|
||||
option: configOption1.option,
|
||||
selectedValue: configOption1.values[1].value,
|
||||
optionsToUpdate: [
|
||||
{
|
||||
option: configOption1.option,
|
||||
selectedValue: configOption1.values[1].value,
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(result).to.be.ok;
|
||||
|
||||
@@ -409,8 +417,12 @@ describe('boards-data-store', function () {
|
||||
);
|
||||
const result = await boardsDataStore.selectConfigOption({
|
||||
fqbn,
|
||||
option: configOption1.option,
|
||||
selectedValue: configOption1.values[1].value,
|
||||
optionsToUpdate: [
|
||||
{
|
||||
option: configOption1.option,
|
||||
selectedValue: configOption1.values[1].value,
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(result).to.be.ok;
|
||||
expect(didChangeCounter).to.be.equal(1);
|
||||
@@ -430,6 +442,220 @@ describe('boards-data-store', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should select multiple config options', async () => {
|
||||
// reconfigure the board details mock for this test case to have multiple config options
|
||||
toDisposeAfterEach.push(
|
||||
mockBoardDetails([
|
||||
{
|
||||
fqbn,
|
||||
...baseDetails,
|
||||
configOptions: [configOption1, configOption2],
|
||||
},
|
||||
])
|
||||
);
|
||||
|
||||
let data = await boardsDataStore.getData(fqbn);
|
||||
expect(data).to.be.deep.equal({
|
||||
configOptions: [configOption1, configOption2],
|
||||
programmers: [edbg, jlink],
|
||||
});
|
||||
|
||||
let didChangeCounter = 0;
|
||||
toDisposeAfterEach.push(
|
||||
boardsDataStore.onDidChange(() => didChangeCounter++)
|
||||
);
|
||||
const result = await boardsDataStore.selectConfigOption({
|
||||
fqbn,
|
||||
optionsToUpdate: [
|
||||
{
|
||||
option: configOption1.option,
|
||||
selectedValue: configOption1.values[1].value,
|
||||
},
|
||||
{
|
||||
option: configOption2.option,
|
||||
selectedValue: configOption2.values[1].value,
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(result).to.be.ok;
|
||||
expect(didChangeCounter).to.be.equal(1);
|
||||
|
||||
data = await boardsDataStore.getData(fqbn);
|
||||
expect(data).to.be.deep.equal({
|
||||
configOptions: [
|
||||
{
|
||||
...configOption1,
|
||||
values: [
|
||||
{ label: 'C1V1', selected: false, value: 'v1' },
|
||||
{ label: 'C1V2', selected: true, value: 'v2' },
|
||||
],
|
||||
},
|
||||
{
|
||||
...configOption2,
|
||||
values: [
|
||||
{ label: 'C2V1', selected: false, value: 'v1' },
|
||||
{ label: 'C2V2', selected: true, value: 'v2' },
|
||||
],
|
||||
},
|
||||
],
|
||||
programmers: [edbg, jlink],
|
||||
});
|
||||
});
|
||||
|
||||
it('should emit a did change event when updating with multiple config options and at least one of them is known (valid option + valid value)', async () => {
|
||||
// reconfigure the board details mock for this test case to have multiple config options
|
||||
toDisposeAfterEach.push(
|
||||
mockBoardDetails([
|
||||
{
|
||||
fqbn,
|
||||
...baseDetails,
|
||||
configOptions: [configOption1, configOption2],
|
||||
},
|
||||
])
|
||||
);
|
||||
|
||||
let data = await boardsDataStore.getData(fqbn);
|
||||
expect(data).to.be.deep.equal({
|
||||
configOptions: [configOption1, configOption2],
|
||||
programmers: [edbg, jlink],
|
||||
});
|
||||
|
||||
let didChangeCounter = 0;
|
||||
toDisposeAfterEach.push(
|
||||
boardsDataStore.onDidChange(() => didChangeCounter++)
|
||||
);
|
||||
const result = await boardsDataStore.selectConfigOption({
|
||||
fqbn,
|
||||
optionsToUpdate: [
|
||||
{
|
||||
option: 'an unknown option',
|
||||
selectedValue: configOption1.values[1].value,
|
||||
},
|
||||
{
|
||||
option: configOption1.option,
|
||||
selectedValue: configOption1.values[1].value,
|
||||
},
|
||||
{
|
||||
option: configOption2.option,
|
||||
selectedValue: 'an unknown value',
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(result).to.be.ok;
|
||||
expect(didChangeCounter).to.be.equal(1);
|
||||
|
||||
data = await boardsDataStore.getData(fqbn);
|
||||
expect(data).to.be.deep.equal({
|
||||
configOptions: [
|
||||
{
|
||||
...configOption1,
|
||||
values: [
|
||||
{ label: 'C1V1', selected: false, value: 'v1' },
|
||||
{ label: 'C1V2', selected: true, value: 'v2' },
|
||||
],
|
||||
},
|
||||
configOption2,
|
||||
],
|
||||
programmers: [edbg, jlink],
|
||||
});
|
||||
});
|
||||
|
||||
it('should not emit a did change event when updating with multiple config options and all of the are unknown', async () => {
|
||||
let data = await boardsDataStore.getData(fqbn);
|
||||
expect(data).to.be.deep.equal({
|
||||
configOptions: [configOption1],
|
||||
programmers: [edbg, jlink],
|
||||
});
|
||||
|
||||
let didChangeCounter = 0;
|
||||
toDisposeAfterEach.push(
|
||||
boardsDataStore.onDidChange(() => didChangeCounter++)
|
||||
);
|
||||
const result = await boardsDataStore.selectConfigOption({
|
||||
fqbn,
|
||||
optionsToUpdate: [
|
||||
{
|
||||
option: 'an unknown option',
|
||||
selectedValue: configOption1.values[1].value,
|
||||
},
|
||||
{
|
||||
option: configOption1.option,
|
||||
selectedValue: 'an unknown value',
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(result).to.be.not.ok;
|
||||
expect(didChangeCounter).to.be.equal(0);
|
||||
|
||||
data = await boardsDataStore.getData(fqbn);
|
||||
expect(data).to.be.deep.equal({
|
||||
configOptions: [configOption1],
|
||||
programmers: [edbg, jlink],
|
||||
});
|
||||
});
|
||||
|
||||
it("should automatically update the selected config options if the boards config change 'reason' is the 'toolbar' and the (CLI) detected FQBN has config options", async () => {
|
||||
// reconfigure the board details mock for this test case to have multiple config options
|
||||
toDisposeAfterEach.push(
|
||||
mockBoardDetails([
|
||||
{
|
||||
fqbn,
|
||||
...baseDetails,
|
||||
configOptions: [configOption1, configOption2],
|
||||
},
|
||||
])
|
||||
);
|
||||
|
||||
let data = await boardsDataStore.getData(fqbn);
|
||||
expect(data).to.be.deep.equal({
|
||||
configOptions: [configOption1, configOption2],
|
||||
programmers: [edbg, jlink],
|
||||
});
|
||||
|
||||
let didChangeCounter = 0;
|
||||
toDisposeAfterEach.push(
|
||||
boardsDataStore.onDidChange(() => didChangeCounter++)
|
||||
);
|
||||
|
||||
const boardsConfig = {
|
||||
selectedPort: unoSerialPort, // the port value does not matter here, but the change must come from a toolbar as a boards config: with port+board,
|
||||
selectedBoard: {
|
||||
fqbn: `${board.fqbn}:${configOption1.option}=${configOption1.values[1].value},${configOption2.option}=${configOption2.values[1].value}`,
|
||||
name: board.name,
|
||||
},
|
||||
};
|
||||
const params: UpdateBoardsConfigParams = {
|
||||
...boardsConfig,
|
||||
reason: 'toolbar',
|
||||
};
|
||||
const updated = boardsServiceProvider.updateConfig(params);
|
||||
expect(updated).to.be.ok;
|
||||
|
||||
await waitForEvent(boardsDataStore.onDidChange, 100);
|
||||
|
||||
expect(didChangeCounter).to.be.equal(1);
|
||||
data = await boardsDataStore.getData(fqbn);
|
||||
expect(data).to.be.deep.equal({
|
||||
configOptions: [
|
||||
{
|
||||
...configOption1,
|
||||
values: [
|
||||
{ label: 'C1V1', selected: false, value: 'v1' },
|
||||
{ label: 'C1V2', selected: true, value: 'v2' },
|
||||
],
|
||||
},
|
||||
{
|
||||
...configOption2,
|
||||
values: [
|
||||
{ label: 'C2V1', selected: false, value: 'v1' },
|
||||
{ label: 'C2V2', selected: true, value: 'v2' },
|
||||
],
|
||||
},
|
||||
],
|
||||
programmers: [edbg, jlink],
|
||||
});
|
||||
});
|
||||
|
||||
it('should not select a config option if the option is absent', async () => {
|
||||
const fqbn = 'a:b:c';
|
||||
let data = await boardsDataStore.getData(fqbn);
|
||||
@@ -444,8 +670,9 @@ describe('boards-data-store', function () {
|
||||
);
|
||||
const result = await boardsDataStore.selectConfigOption({
|
||||
fqbn,
|
||||
option: 'missing',
|
||||
selectedValue: configOption1.values[1].value,
|
||||
optionsToUpdate: [
|
||||
{ option: 'missing', selectedValue: configOption1.values[1].value },
|
||||
],
|
||||
});
|
||||
expect(result).to.be.not.ok;
|
||||
expect(didChangeCounter).to.be.equal(0);
|
||||
@@ -470,8 +697,9 @@ describe('boards-data-store', function () {
|
||||
);
|
||||
const result = await boardsDataStore.selectConfigOption({
|
||||
fqbn,
|
||||
option: configOption1.option,
|
||||
selectedValue: 'missing',
|
||||
optionsToUpdate: [
|
||||
{ option: configOption1.option, selectedValue: 'missing' },
|
||||
],
|
||||
});
|
||||
expect(result).to.be.not.ok;
|
||||
expect(didChangeCounter).to.be.equal(0);
|
||||
|
||||
@@ -28,7 +28,6 @@ import {
|
||||
debuggingNotSupported,
|
||||
isDebugEnabled,
|
||||
noPlatformInstalledFor,
|
||||
noProgrammerSelectedFor,
|
||||
} from '../../browser/contributions/debug';
|
||||
import { NotificationCenter } from '../../browser/notification-center';
|
||||
import { noBoardSelected } from '../../common/nls';
|
||||
@@ -117,20 +116,20 @@ describe('debug', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('should error when no programmer selected', async () => {
|
||||
it('should resolve when no programmer is selected (arduino/arduino-cli#2540)', async () => {
|
||||
const copyData: Mutable<BoardsDataStore.Data> = deepClone(data);
|
||||
delete copyData.selectedProgrammer;
|
||||
await rejects(
|
||||
await doesNotReject(
|
||||
isDebugEnabled(
|
||||
board,
|
||||
() => boardDetails,
|
||||
() => copyData,
|
||||
(fqbn) => fqbn,
|
||||
unexpectedCall()
|
||||
),
|
||||
(reason) =>
|
||||
reason instanceof Error &&
|
||||
reason.message === noProgrammerSelectedFor(board.name)
|
||||
async (params) => {
|
||||
expect(params.programmer).to.be.undefined;
|
||||
return params.fqbn;
|
||||
}
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
121
arduino-ide-extension/src/test/browser/widgets.test.ts
Normal file
121
arduino-ide-extension/src/test/browser/widgets.test.ts
Normal file
@@ -0,0 +1,121 @@
|
||||
import {
|
||||
Disposable,
|
||||
DisposableCollection,
|
||||
} from '@theia/core/lib/common/disposable';
|
||||
import type { PanelLayout, Widget } from '@theia/core/shared/@phosphor/widgets';
|
||||
import { expect } from 'chai';
|
||||
import type {
|
||||
removeWidgetIfPresent,
|
||||
unshiftWidgetIfNotPresent,
|
||||
} from '../../browser/theia/dialogs/widgets';
|
||||
|
||||
describe('widgets', () => {
|
||||
let toDispose: DisposableCollection;
|
||||
|
||||
beforeEach(() => {
|
||||
const disableJSDOM =
|
||||
require('@theia/core/lib/browser/test/jsdom').enableJSDOM();
|
||||
toDispose = new DisposableCollection(
|
||||
Disposable.create(() => disableJSDOM())
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(() => toDispose.dispose());
|
||||
|
||||
describe('removeWidgetIfPresent', () => {
|
||||
let testMe: typeof removeWidgetIfPresent;
|
||||
|
||||
beforeEach(
|
||||
() =>
|
||||
(testMe =
|
||||
require('../../browser/theia/dialogs/widgets').removeWidgetIfPresent)
|
||||
);
|
||||
|
||||
it('should remove the widget if present', () => {
|
||||
const layout = newPanelLayout();
|
||||
const widget = newWidget();
|
||||
layout.addWidget(widget);
|
||||
const toRemoveWidget = newWidget();
|
||||
layout.addWidget(toRemoveWidget);
|
||||
|
||||
expect(layout.widgets).to.be.deep.equal([widget, toRemoveWidget]);
|
||||
|
||||
testMe(layout, toRemoveWidget);
|
||||
|
||||
expect(layout.widgets).to.be.deep.equal([widget]);
|
||||
});
|
||||
|
||||
it('should be noop if the widget is not part of the layout', () => {
|
||||
const layout = newPanelLayout();
|
||||
const widget = newWidget();
|
||||
layout.addWidget(widget);
|
||||
|
||||
expect(layout.widgets).to.be.deep.equal([widget]);
|
||||
|
||||
testMe(layout, newWidget());
|
||||
|
||||
expect(layout.widgets).to.be.deep.equal([widget]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('unshiftWidgetIfNotPresent', () => {
|
||||
let testMe: typeof unshiftWidgetIfNotPresent;
|
||||
|
||||
beforeEach(
|
||||
() =>
|
||||
(testMe =
|
||||
require('../../browser/theia/dialogs/widgets').unshiftWidgetIfNotPresent)
|
||||
);
|
||||
|
||||
it('should unshift the widget if not present', () => {
|
||||
const layout = newPanelLayout();
|
||||
const widget = newWidget();
|
||||
layout.addWidget(widget);
|
||||
|
||||
expect(layout.widgets).to.be.deep.equal([widget]);
|
||||
|
||||
const toAdd = newWidget();
|
||||
testMe(layout, toAdd);
|
||||
|
||||
expect(layout.widgets).to.be.deep.equal([toAdd, widget]);
|
||||
});
|
||||
|
||||
it('should be NOOP if widget is already part of the layout (at 0 index)', () => {
|
||||
const layout = newPanelLayout();
|
||||
const toAdd = newWidget();
|
||||
layout.addWidget(toAdd);
|
||||
const widget = newWidget();
|
||||
layout.addWidget(widget);
|
||||
|
||||
expect(layout.widgets).to.be.deep.equal([toAdd, widget]);
|
||||
|
||||
testMe(layout, toAdd);
|
||||
|
||||
expect(layout.widgets).to.be.deep.equal([toAdd, widget]);
|
||||
});
|
||||
|
||||
it('should be NOOP if widget is already part of the layout (at >0 index)', () => {
|
||||
const layout = newPanelLayout();
|
||||
const widget = newWidget();
|
||||
layout.addWidget(widget);
|
||||
const toAdd = newWidget();
|
||||
layout.addWidget(toAdd);
|
||||
|
||||
expect(layout.widgets).to.be.deep.equal([widget, toAdd]);
|
||||
|
||||
testMe(layout, toAdd);
|
||||
|
||||
expect(layout.widgets).to.be.deep.equal([widget, toAdd]);
|
||||
});
|
||||
});
|
||||
|
||||
function newWidget(): Widget {
|
||||
const { Widget } = require('@theia/core/shared/@phosphor/widgets');
|
||||
return new Widget();
|
||||
}
|
||||
|
||||
function newPanelLayout(): PanelLayout {
|
||||
const { PanelLayout } = require('@theia/core/shared/@phosphor/widgets');
|
||||
return new PanelLayout();
|
||||
}
|
||||
});
|
||||
@@ -21,7 +21,7 @@ class SilentArduinoDaemonImpl extends ArduinoDaemonImpl {
|
||||
|
||||
override async spawnDaemonProcess(): Promise<{
|
||||
daemon: ChildProcess;
|
||||
port: string;
|
||||
port: number;
|
||||
}> {
|
||||
return super.spawnDaemonProcess();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
||||
import {
|
||||
Disposable,
|
||||
DisposableCollection,
|
||||
} from '@theia/core/lib/common/disposable';
|
||||
import { Container } from '@theia/core/shared/inversify';
|
||||
import { expect } from 'chai';
|
||||
import { BoardSearch, BoardsService } from '../../common/protocol';
|
||||
import { promises as fs } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import temp from 'temp';
|
||||
import {
|
||||
BoardSearch,
|
||||
BoardsPackage,
|
||||
BoardsService,
|
||||
Installable,
|
||||
} from '../../common/protocol';
|
||||
import { createBaseContainer, startDaemon } from './node-test-bindings';
|
||||
|
||||
describe('boards-service-impl', () => {
|
||||
@@ -10,8 +21,12 @@ describe('boards-service-impl', () => {
|
||||
|
||||
before(async function () {
|
||||
this.timeout(20_000);
|
||||
toDispose = new DisposableCollection();
|
||||
const container = await createContainer();
|
||||
const tracked = temp.track();
|
||||
toDispose = new DisposableCollection(
|
||||
Disposable.create(() => tracked.cleanupSync())
|
||||
);
|
||||
const testDirPath = tracked.mkdirSync();
|
||||
const container = await createContainer(testDirPath);
|
||||
await start(container, toDispose);
|
||||
boardService = container.get<BoardsService>(BoardsService);
|
||||
});
|
||||
@@ -24,6 +39,29 @@ describe('boards-service-impl', () => {
|
||||
expect(result).is.not.empty;
|
||||
});
|
||||
|
||||
it('should order the available platform release versions in descending order', async function () {
|
||||
const result = await boardService.search({});
|
||||
result.forEach((platform) =>
|
||||
platform.availableVersions.forEach(
|
||||
(currentVersion, index, versions) => {
|
||||
if (index < versions.length - 2) {
|
||||
const nextArrayElement = versions[index + 1];
|
||||
const actual = Installable.Version.COMPARATOR(
|
||||
currentVersion,
|
||||
nextArrayElement
|
||||
);
|
||||
expect(actual).to.be.greaterThan(
|
||||
0,
|
||||
`Expected '${currentVersion}' to be gt '${nextArrayElement}'. All versions: ${JSON.stringify(
|
||||
versions
|
||||
)}`
|
||||
);
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
it("should boost a result when 'types' includes 'arduino', and lower the score if deprecated", async () => {
|
||||
const result = await boardService.search({});
|
||||
const arduinoIndexes: number[] = [];
|
||||
@@ -87,10 +125,45 @@ describe('boards-service-impl', () => {
|
||||
expect(first.deprecated).to.be.false;
|
||||
});
|
||||
});
|
||||
|
||||
it('should have the installed version set', async function () {
|
||||
const timeout = 5 * 60 * 1_000; // five minutes to install/uninstall the core
|
||||
this.timeout(timeout);
|
||||
|
||||
// ensure installed
|
||||
let result = await boardService.search({ query: 'arduino:avr' });
|
||||
let avr = result.find(
|
||||
(boardsPackage) => boardsPackage.id === 'arduino:avr'
|
||||
);
|
||||
expect(avr).to.be.not.undefined;
|
||||
await boardService.install({
|
||||
item: <BoardsPackage>avr,
|
||||
skipPostInstall: true,
|
||||
});
|
||||
|
||||
// when installed the version is set
|
||||
result = await boardService.search({ query: 'arduino:avr' });
|
||||
avr = result.find((boardsPackage) => boardsPackage.id === 'arduino:avr');
|
||||
expect(avr).to.be.not.undefined;
|
||||
expect(avr?.installedVersion).to.be.not.undefined;
|
||||
|
||||
// uninstall the core
|
||||
await boardService.uninstall({ item: <BoardsPackage>avr });
|
||||
result = await boardService.search({ query: 'arduino:avr' });
|
||||
avr = result.find((boardsPackage) => boardsPackage.id === 'arduino:avr');
|
||||
expect(avr).to.be.not.undefined;
|
||||
expect(avr?.installedVersion).to.be.undefined;
|
||||
});
|
||||
});
|
||||
|
||||
async function createContainer(): Promise<Container> {
|
||||
return createBaseContainer();
|
||||
async function createContainer(testDirPath: string): Promise<Container> {
|
||||
const data = path.join(testDirPath, 'data');
|
||||
const user = path.join(testDirPath, 'user');
|
||||
await Promise.all([
|
||||
fs.mkdir(data, { recursive: true }),
|
||||
fs.mkdir(user, { recursive: true }),
|
||||
]);
|
||||
return createBaseContainer({ cliConfig: { directories: { data, user } } });
|
||||
}
|
||||
|
||||
async function start(
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
import {
|
||||
Disposable,
|
||||
DisposableCollection,
|
||||
} from '@theia/core/lib/common/disposable';
|
||||
import { deepClone } from '@theia/core/lib/common/objects';
|
||||
import type { MaybePromise, Mutable } from '@theia/core/lib/common/types';
|
||||
import type { Container } from '@theia/core/shared/inversify';
|
||||
import { expect } from 'chai';
|
||||
import { load as parseYaml } from 'js-yaml';
|
||||
import { promises as fs } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import temp from 'temp';
|
||||
import {
|
||||
Config,
|
||||
Network,
|
||||
ProxySettings,
|
||||
} from '../../common/protocol/config-service';
|
||||
import { CLI_CONFIG, DefaultCliConfig } from '../../node/cli-config';
|
||||
import { ConfigServiceImpl } from '../../node/config-service-impl';
|
||||
import { ConfigDirUriProvider } from '../../node/theia/env-variables/env-variables-server';
|
||||
import {
|
||||
createBaseContainer,
|
||||
createCliConfig,
|
||||
startDaemon,
|
||||
} from './node-test-bindings';
|
||||
|
||||
describe('config-service-impl', () => {
|
||||
const noProxy = 'none';
|
||||
const manualProxy: ProxySettings = {
|
||||
protocol: 'http',
|
||||
hostname: 'hostname',
|
||||
password: 'secret',
|
||||
username: 'username',
|
||||
port: '1234',
|
||||
};
|
||||
|
||||
describe('setConfiguration', () => {
|
||||
let configService: ConfigServiceImpl;
|
||||
let toDispose: DisposableCollection;
|
||||
let cliConfigPath: string;
|
||||
|
||||
beforeEach(async () => {
|
||||
const container = await createBaseContainer();
|
||||
toDispose = new DisposableCollection();
|
||||
await startDaemon(container, toDispose);
|
||||
configService = container.get<ConfigServiceImpl>(ConfigServiceImpl);
|
||||
cliConfigPath = getCliConfigPath(container);
|
||||
});
|
||||
|
||||
afterEach(() => toDispose.dispose());
|
||||
|
||||
it("should detect 'none' proxy with th default config", async () => {
|
||||
const state = await configService.getConfiguration();
|
||||
expect(state.config).to.be.not.undefined;
|
||||
const config = <Config>state.config;
|
||||
expect(config.network).to.be.equal(noProxy);
|
||||
expect(Network.stringify(config.network)).is.undefined;
|
||||
await assertRawConfigModel(cliConfigPath, (actualModel) => {
|
||||
expect(actualModel.network).to.be.undefined;
|
||||
});
|
||||
});
|
||||
|
||||
it('should ignore noop changes', async () => {
|
||||
const beforeState = await configService.getConfiguration();
|
||||
const config = <Mutable<Config>>deepClone(beforeState).config;
|
||||
let eventCounter = 0;
|
||||
toDispose.push(configService.onConfigChange(() => eventCounter++));
|
||||
await configService.setConfiguration(config);
|
||||
const afterState = await configService.getConfiguration();
|
||||
expect(beforeState.config).to.be.deep.equal(afterState.config);
|
||||
expect(eventCounter).to.be.equal(0);
|
||||
});
|
||||
|
||||
it('should set the manual proxy', async () => {
|
||||
const beforeState = await configService.getConfiguration();
|
||||
const config = <Mutable<Config>>deepClone(beforeState).config;
|
||||
config.network = manualProxy;
|
||||
let eventCounter = 0;
|
||||
toDispose.push(configService.onConfigChange(() => eventCounter++));
|
||||
await configService.setConfiguration(config);
|
||||
const afterState = await configService.getConfiguration();
|
||||
expect(beforeState.config).to.be.not.deep.equal(afterState.config);
|
||||
expect(afterState.config?.network).to.be.deep.equal(manualProxy);
|
||||
expect(eventCounter).to.be.equal(1);
|
||||
await assertRawConfigModel(cliConfigPath, (actualModel) => {
|
||||
expect(actualModel.network?.proxy).to.be.equal(
|
||||
Network.stringify(manualProxy)
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('should unset the manual proxy', async () => {
|
||||
const initialState = await configService.getConfiguration();
|
||||
const config = <Mutable<Config>>deepClone(initialState).config;
|
||||
config.network = manualProxy;
|
||||
let eventCounter = 0;
|
||||
toDispose.push(configService.onConfigChange(() => eventCounter++));
|
||||
await configService.setConfiguration(config);
|
||||
const beforeState = await configService.getConfiguration();
|
||||
const config2 = <Mutable<Config>>deepClone(config);
|
||||
config2.network = noProxy;
|
||||
await configService.setConfiguration(config2);
|
||||
const afterState = await configService.getConfiguration();
|
||||
expect(beforeState.config).to.be.not.deep.equal(afterState.config);
|
||||
expect(afterState.config?.network).to.be.deep.equal(noProxy);
|
||||
expect(eventCounter).to.be.equal(2);
|
||||
await assertRawConfigModel(cliConfigPath, (actualModel) => {
|
||||
expect(actualModel.network?.proxy).to.be.undefined;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('setConfiguration (multiple CLI daemon sessions)', () => {
|
||||
let tracked: typeof temp;
|
||||
let toDispose: DisposableCollection;
|
||||
|
||||
before(() => {
|
||||
tracked = temp.track();
|
||||
toDispose = new DisposableCollection(
|
||||
Disposable.create(() => tracked.cleanupSync())
|
||||
);
|
||||
});
|
||||
|
||||
after(() => toDispose.dispose());
|
||||
|
||||
it("should unset the 'network#proxy' config value between daemon sessions", async () => {
|
||||
const configDirPath = tracked.mkdirSync();
|
||||
const cliConfigPath = join(configDirPath, CLI_CONFIG);
|
||||
const cliConfig = await createCliConfig(configDirPath);
|
||||
const setupContainer = await createBaseContainer({
|
||||
cliConfig,
|
||||
configDirPath,
|
||||
});
|
||||
const toDisposeAfterFirstStart = new DisposableCollection();
|
||||
toDispose.push(toDisposeAfterFirstStart);
|
||||
await startDaemon(setupContainer, toDisposeAfterFirstStart);
|
||||
toDisposeAfterFirstStart.dispose();
|
||||
|
||||
// second startup when the indexes are all downloaded and the daemon is initialized with the network#proxy
|
||||
cliConfig.network = { proxy: Network.stringify(manualProxy) };
|
||||
const container = await createBaseContainer({ cliConfig, configDirPath });
|
||||
await startDaemon(container, toDispose);
|
||||
const configService = container.get<ConfigServiceImpl>(ConfigServiceImpl);
|
||||
let eventCounter = 0;
|
||||
toDispose.push(configService.onConfigChange(() => eventCounter++));
|
||||
|
||||
const beforeState = await configService.getConfiguration();
|
||||
const config = <Mutable<Config>>deepClone(beforeState.config);
|
||||
config.network = noProxy;
|
||||
await configService.setConfiguration(config);
|
||||
const afterState = await configService.getConfiguration();
|
||||
expect(beforeState.config).to.be.not.deep.equal(afterState.config);
|
||||
expect(afterState.config?.network).to.be.deep.equal(noProxy);
|
||||
expect(eventCounter).to.be.equal(1);
|
||||
await assertRawConfigModel(cliConfigPath, (actualModel) => {
|
||||
expect(actualModel.network?.proxy).to.be.undefined; // currently fails due to arduino/arduino-cli#2275
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
async function assertRawConfigModel(
|
||||
cliConfigPath: string,
|
||||
assert: (actual: DefaultCliConfig) => MaybePromise<void>
|
||||
): Promise<void> {
|
||||
const raw = await fs.readFile(cliConfigPath, { encoding: 'utf8' });
|
||||
const model = parseYaml(raw);
|
||||
await assert(model);
|
||||
}
|
||||
|
||||
function getCliConfigPath(container: Container): string {
|
||||
const configDirUriProvider =
|
||||
container.get<ConfigDirUriProvider>(ConfigDirUriProvider);
|
||||
return configDirUriProvider
|
||||
.configDirUri()
|
||||
.resolve(CLI_CONFIG)
|
||||
.path.fsPath();
|
||||
}
|
||||
});
|
||||
@@ -111,7 +111,7 @@ class TestNotificationServiceServer implements NotificationServiceServer {
|
||||
notifyIndexUpdateDidFail(params: IndexUpdateDidFailParams): void {
|
||||
this.events.push(`notifyIndexUpdateDidFail:${JSON.stringify(params)}`);
|
||||
}
|
||||
notifyDaemonDidStart(port: string): void {
|
||||
notifyDaemonDidStart(port: number): void {
|
||||
this.events.push(`notifyDaemonDidStart:${port}`);
|
||||
}
|
||||
notifyDaemonDidStop(): void {
|
||||
|
||||
@@ -3,17 +3,19 @@ import {
|
||||
DisposableCollection,
|
||||
} from '@theia/core/lib/common/disposable';
|
||||
import { isWindows } from '@theia/core/lib/common/os';
|
||||
import { URI } from '@theia/core/lib/common/uri';
|
||||
import { FileUri } from '@theia/core/lib/node/file-uri';
|
||||
import { Container } from '@theia/core/shared/inversify';
|
||||
import { expect } from 'chai';
|
||||
import { rejects } from 'node:assert/strict';
|
||||
import { promises as fs } from 'node:fs';
|
||||
import { basename, join } from 'node:path';
|
||||
import path, { basename, join } from 'node:path';
|
||||
import { sync as rimrafSync } from 'rimraf';
|
||||
import temp from 'temp';
|
||||
import { Sketch, SketchesService } from '../../common/protocol';
|
||||
import { Sketch, SketchesError, SketchesService } from '../../common/protocol';
|
||||
import {
|
||||
isAccessibleSketchPath,
|
||||
SketchesServiceImpl,
|
||||
isAccessibleSketchPath,
|
||||
} from '../../node/sketches-service-impl';
|
||||
import { ErrnoException } from '../../node/utils/errors';
|
||||
import { createBaseContainer, startDaemon } from './node-test-bindings';
|
||||
@@ -138,12 +140,62 @@ describe('sketches-service-impl', () => {
|
||||
|
||||
after(() => toDispose.dispose());
|
||||
|
||||
describe('copy', () => {
|
||||
it('should copy a sketch when the destination does not exist', async function () {
|
||||
this.timeout(testTimeout);
|
||||
describe('copy', function () {
|
||||
this.timeout(testTimeout);
|
||||
this.slow(250);
|
||||
|
||||
it('should error when the destination sketch folder name is invalid', async () => {
|
||||
const sketchesService =
|
||||
container.get<SketchesServiceImpl>(SketchesService);
|
||||
const destinationPath = await sketchesService['createTempFolder']();
|
||||
const tempDirPath = await sketchesService['createTempFolder']();
|
||||
const destinationPath = join(tempDirPath, 'invalid with spaces');
|
||||
const sketch = await sketchesService.createNewSketch();
|
||||
toDispose.push(disposeSketch(sketch));
|
||||
await rejects(
|
||||
sketchesService.copy(sketch, {
|
||||
destinationUri: FileUri.create(destinationPath).toString(),
|
||||
}),
|
||||
SketchesError.InvalidFolderName.is
|
||||
);
|
||||
});
|
||||
|
||||
it('should error when the destination sketch folder name collides with an existing sketch file name', async () => {
|
||||
const sketchesService =
|
||||
container.get<SketchesServiceImpl>(SketchesService);
|
||||
const tempDirPath = await sketchesService['createTempFolder']();
|
||||
const destinationPath = join(tempDirPath, 'ExistingSketchFile');
|
||||
let sketch = await sketchesService.createNewSketch();
|
||||
toDispose.push(disposeSketch(sketch));
|
||||
const sourcePath = FileUri.fsPath(sketch.uri);
|
||||
const otherInoBasename = 'ExistingSketchFile.ino';
|
||||
const otherInoPath = join(sourcePath, otherInoBasename);
|
||||
await fs.writeFile(otherInoPath, '// a comment', { encoding: 'utf8' });
|
||||
|
||||
sketch = await sketchesService.loadSketch(sketch.uri);
|
||||
expect(Sketch.isInSketch(FileUri.create(otherInoPath), sketch)).to.be
|
||||
.true;
|
||||
|
||||
await rejects(
|
||||
sketchesService.copy(sketch, {
|
||||
destinationUri: FileUri.create(destinationPath).toString(),
|
||||
}),
|
||||
(reason) => {
|
||||
return (
|
||||
typeof reason === 'object' &&
|
||||
reason !== null &&
|
||||
SketchesError.SketchAlreadyContainsThisFile.is(reason) &&
|
||||
reason.data.existingSketchFilename === otherInoBasename
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('should copy a sketch when the destination does not exist', async () => {
|
||||
const sketchesService =
|
||||
container.get<SketchesServiceImpl>(SketchesService);
|
||||
const tempDirPath = await sketchesService['createTempFolder']();
|
||||
const destinationPath = join(tempDirPath, 'Does_Not_Exist_but_valid');
|
||||
await rejects(fs.readdir(destinationPath), ErrnoException.isENOENT);
|
||||
let sketch = await sketchesService.createNewSketch();
|
||||
toDispose.push(disposeSketch(sketch));
|
||||
const sourcePath = FileUri.fsPath(sketch.uri);
|
||||
@@ -187,11 +239,11 @@ describe('sketches-service-impl', () => {
|
||||
).to.be.true;
|
||||
});
|
||||
|
||||
it("should copy only sketch files if 'onlySketchFiles' is true", async function () {
|
||||
this.timeout(testTimeout);
|
||||
it("should copy only sketch files if 'onlySketchFiles' is true", async () => {
|
||||
const sketchesService =
|
||||
container.get<SketchesServiceImpl>(SketchesService);
|
||||
const destinationPath = await sketchesService['createTempFolder']();
|
||||
const tempDirPath = await sketchesService['createTempFolder']();
|
||||
const destinationPath = join(tempDirPath, 'OnlySketchFiles');
|
||||
let sketch = await sketchesService.createNewSketch();
|
||||
toDispose.push(disposeSketch(sketch));
|
||||
const sourcePath = FileUri.fsPath(sketch.uri);
|
||||
@@ -207,11 +259,25 @@ describe('sketches-service-impl', () => {
|
||||
const logContent = 'log file content';
|
||||
const logPath = join(sourcePath, logBasename);
|
||||
await fs.writeFile(logPath, logContent, { encoding: 'utf8' });
|
||||
const srcPath = join(sourcePath, 'src');
|
||||
await fs.mkdir(srcPath, { recursive: true });
|
||||
const libInSrcBasename = 'lib_in_src.cpp';
|
||||
const libInSrcContent = 'lib in src content';
|
||||
const libInSrcPath = join(srcPath, libInSrcBasename);
|
||||
await fs.writeFile(libInSrcPath, libInSrcContent, { encoding: 'utf8' });
|
||||
const logInSrcBasename = 'inols-clangd-err_in_src.log';
|
||||
const logInSrcContent = 'log file content in src';
|
||||
const logInSrcPath = join(srcPath, logInSrcBasename);
|
||||
await fs.writeFile(logInSrcPath, logInSrcContent, { encoding: 'utf8' });
|
||||
|
||||
sketch = await sketchesService.loadSketch(sketch.uri);
|
||||
expect(Sketch.isInSketch(FileUri.create(libPath), sketch)).to.be.true;
|
||||
expect(Sketch.isInSketch(FileUri.create(headerPath), sketch)).to.be.true;
|
||||
expect(Sketch.isInSketch(FileUri.create(logPath), sketch)).to.be.false;
|
||||
expect(Sketch.isInSketch(FileUri.create(libInSrcPath), sketch)).to.be
|
||||
.true;
|
||||
expect(Sketch.isInSketch(FileUri.create(logInSrcPath), sketch)).to.be
|
||||
.false;
|
||||
const reloadedLogContent = await fs.readFile(logPath, {
|
||||
encoding: 'utf8',
|
||||
});
|
||||
@@ -249,20 +315,56 @@ describe('sketches-service-impl', () => {
|
||||
copied
|
||||
)
|
||||
).to.be.false;
|
||||
try {
|
||||
await fs.readFile(join(destinationPath, logBasename), {
|
||||
encoding: 'utf8',
|
||||
});
|
||||
expect.fail(
|
||||
'Log file must not exist in the destination. Expected ENOENT when loading the log file.'
|
||||
);
|
||||
} catch (err) {
|
||||
expect(ErrnoException.isENOENT(err)).to.be.true;
|
||||
}
|
||||
expect(
|
||||
Sketch.isInSketch(
|
||||
FileUri.create(join(destinationPath, 'src', libInSrcBasename)),
|
||||
copied
|
||||
)
|
||||
).to.be.true;
|
||||
expect(
|
||||
Sketch.isInSketch(
|
||||
FileUri.create(join(destinationPath, 'src', logInSrcBasename)),
|
||||
copied
|
||||
)
|
||||
).to.be.false;
|
||||
await rejects(
|
||||
fs.readFile(join(destinationPath, logBasename)),
|
||||
ErrnoException.isENOENT
|
||||
);
|
||||
});
|
||||
|
||||
it('should copy sketch inside the sketch folder', async function () {
|
||||
this.timeout(testTimeout);
|
||||
it('should copy sketch if the main sketch file has pde extension (#2377)', async () => {
|
||||
const sketchesService =
|
||||
container.get<SketchesServiceImpl>(SketchesService);
|
||||
let sketch = await sketchesService.createNewSketch();
|
||||
toDispose.push(disposeSketch(sketch));
|
||||
expect(sketch.mainFileUri.endsWith('.ino')).to.be.true;
|
||||
|
||||
// Create a sketch and rename the main sketch file to .pde
|
||||
const mainSketchFilePathIno = FileUri.fsPath(new URI(sketch.mainFileUri));
|
||||
const sketchFolderPath = path.dirname(mainSketchFilePathIno);
|
||||
const mainSketchFilePathPde = path.join(
|
||||
sketchFolderPath,
|
||||
`${basename(sketchFolderPath)}.pde`
|
||||
);
|
||||
await fs.rename(mainSketchFilePathIno, mainSketchFilePathPde);
|
||||
|
||||
sketch = await sketchesService.loadSketch(sketch.uri);
|
||||
expect(sketch.mainFileUri.endsWith('.pde')).to.be.true;
|
||||
|
||||
const tempDirPath = await sketchesService['createTempFolder']();
|
||||
const destinationPath = join(tempDirPath, 'GH-2377');
|
||||
const destinationUri = FileUri.create(destinationPath).toString();
|
||||
|
||||
await sketchesService.copy(sketch, {
|
||||
destinationUri,
|
||||
});
|
||||
|
||||
const copiedSketch = await sketchesService.loadSketch(destinationUri);
|
||||
expect(copiedSketch.mainFileUri.endsWith('.ino')).to.be.true;
|
||||
});
|
||||
|
||||
it('should copy sketch inside the sketch folder', async () => {
|
||||
const sketchesService =
|
||||
container.get<SketchesServiceImpl>(SketchesService);
|
||||
let sketch = await sketchesService.createNewSketch();
|
||||
@@ -309,6 +411,55 @@ describe('sketches-service-impl', () => {
|
||||
).to.be.true;
|
||||
});
|
||||
|
||||
it('should not modify the subfolder structure', async () => {
|
||||
const sketchesService =
|
||||
container.get<SketchesServiceImpl>(SketchesService);
|
||||
const tempDirPath = await sketchesService['createTempFolder']();
|
||||
const destinationPath = join(tempDirPath, 'HasSubfolders_copy');
|
||||
await fs.mkdir(destinationPath, { recursive: true });
|
||||
let sketch = await sketchesService.createNewSketch('HasSubfolders');
|
||||
toDispose.push(disposeSketch(sketch));
|
||||
|
||||
const sourcePath = FileUri.fsPath(sketch.uri);
|
||||
const srcPath = join(sourcePath, 'src');
|
||||
await fs.mkdir(srcPath, { recursive: true });
|
||||
const headerPath = join(srcPath, 'FomSubfolder.h');
|
||||
await fs.writeFile(headerPath, '// empty', { encoding: 'utf8' });
|
||||
|
||||
sketch = await sketchesService.loadSketch(sketch.uri);
|
||||
|
||||
expect(sketch.mainFileUri).to.be.equal(
|
||||
FileUri.create(join(sourcePath, 'HasSubfolders.ino')).toString()
|
||||
);
|
||||
expect(sketch.additionalFileUris).to.be.deep.equal([
|
||||
FileUri.create(join(srcPath, 'FomSubfolder.h')).toString(),
|
||||
]);
|
||||
expect(sketch.otherSketchFileUris).to.be.empty;
|
||||
expect(sketch.rootFolderFileUris).to.be.empty;
|
||||
|
||||
const destinationUri = FileUri.create(destinationPath).toString();
|
||||
const copySketch = await sketchesService.copy(sketch, { destinationUri });
|
||||
toDispose.push(disposeSketch(copySketch));
|
||||
expect(copySketch.mainFileUri).to.be.equal(
|
||||
FileUri.create(
|
||||
join(destinationPath, 'HasSubfolders_copy.ino')
|
||||
).toString()
|
||||
);
|
||||
expect(copySketch.additionalFileUris).to.be.deep.equal([
|
||||
FileUri.create(
|
||||
join(destinationPath, 'src', 'FomSubfolder.h')
|
||||
).toString(),
|
||||
]);
|
||||
expect(copySketch.otherSketchFileUris).to.be.empty;
|
||||
expect(copySketch.rootFolderFileUris).to.be.empty;
|
||||
|
||||
const actualHeaderContent = await fs.readFile(
|
||||
join(destinationPath, 'src', 'FomSubfolder.h'),
|
||||
{ encoding: 'utf8' }
|
||||
);
|
||||
expect(actualHeaderContent).to.be.equal('// empty');
|
||||
});
|
||||
|
||||
it('should copy sketch with overwrite when source and destination sketch folder names are the same', async function () {
|
||||
this.timeout(testTimeout);
|
||||
const sketchesService =
|
||||
@@ -346,7 +497,7 @@ describe('sketches-service-impl', () => {
|
||||
[
|
||||
'<',
|
||||
'>',
|
||||
'chevrons',
|
||||
'lt+gt',
|
||||
{
|
||||
predicate: () => isWindows,
|
||||
why: '< (less than) and > (greater than) are reserved characters on Windows (https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions)',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "electron-app",
|
||||
"version": "2.2.2",
|
||||
"version": "2.3.3",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"main": "./src-gen/backend/electron-main.js",
|
||||
"dependencies": {
|
||||
@@ -19,7 +19,7 @@
|
||||
"@theia/preferences": "1.41.0",
|
||||
"@theia/terminal": "1.41.0",
|
||||
"@theia/workspace": "1.41.0",
|
||||
"arduino-ide-extension": "2.2.2"
|
||||
"arduino-ide-extension": "2.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@theia/cli": "1.41.0",
|
||||
@@ -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.1.1.vsix",
|
||||
"vscode-arduino-tools": "https://downloads.arduino.cc/vscode-arduino-tools/vscode-arduino-tools-0.1.3.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",
|
||||
|
||||
@@ -139,6 +139,7 @@
|
||||
"installManually": "Install Manually",
|
||||
"later": "Later",
|
||||
"noBoardSelected": "Geen bord geselekteer",
|
||||
"noSketchOpened": "No sketch opened",
|
||||
"notConnected": "[nie gekoppel]",
|
||||
"offlineIndicator": "Dit lyk of jy van af lyn is. Sonder 'n internetverbinding kan die Arduino CLI moontlik nie die nodige hulpbronne aflaai nie en kan dit wanfunksionering veroorsaak. Koppel asseblief aan die internet en herbegin die toepassing.",
|
||||
"oldFormat": "The '{0}' still uses the old `.pde` format. Do you want to switch to the new `.ino` extension?",
|
||||
@@ -146,6 +147,7 @@
|
||||
"processing": "Verwerking",
|
||||
"recommended": "Recommended",
|
||||
"retired": "Retired",
|
||||
"selectManually": "Select Manually",
|
||||
"selectedOn": "aan {0}",
|
||||
"serialMonitor": "Seriaal Monitor",
|
||||
"type": "Type",
|
||||
@@ -209,7 +211,9 @@
|
||||
"debug": {
|
||||
"debugWithMessage": "Ontfouting {0}",
|
||||
"debuggingNotSupported": "Debugging is not supported by '{0}'",
|
||||
"getDebugInfo": "Getting debug info...",
|
||||
"noPlatformInstalledFor": "Platform is nie geïnstalleer vir ' {0} '",
|
||||
"noProgrammerSelectedFor": "No programmer selected for '{0}'",
|
||||
"optimizeForDebugging": "Geoptimaliseerd vir ontfouting",
|
||||
"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?"
|
||||
},
|
||||
@@ -381,6 +385,7 @@
|
||||
"invalid.editorFontSize": "Invalid editor font size. It must be a positive integer.",
|
||||
"invalid.sketchbook.location": "Invalid sketchbook location: {0}",
|
||||
"invalid.theme": "Invalid theme.",
|
||||
"language.asyncWorkers": "Number of async workers used by the Arduino Language Server (clangd). Background index also uses this many workers. The minimum value is 0, and the maximum is 8. When it is 0, the language server uses all available cores. The default value is 0.",
|
||||
"language.log": "True if the Arduino Language Server should generate log files into the sketch folder. Otherwise, false. It's false by default.",
|
||||
"language.realTimeDiagnostics": "If true, the language server provides real-time diagnostics when typing in the editor. It's false by default.",
|
||||
"manualProxy": "Manual proxy configuration",
|
||||
@@ -460,6 +465,8 @@
|
||||
"saveSketchAs": "Save sketch folder as...",
|
||||
"showFolder": "Show Sketch Folder",
|
||||
"sketch": "Skets",
|
||||
"sketchAlreadyContainsThisFileError": "The sketch already contains a file named '{0}'",
|
||||
"sketchAlreadyContainsThisFileMessage": "Failed to save sketch \"{0}\" as \"{1}\". {2}",
|
||||
"sketchbook": "Sketchbook",
|
||||
"titleLocalSketchbook": "Local Sketchbook",
|
||||
"titleSketchbook": "Sketchbook",
|
||||
|
||||
23
i18n/ar.json
23
i18n/ar.json
@@ -18,7 +18,7 @@
|
||||
"configDialog1": "اختر لوحة و منفذ معا اذا اردت ان ترفع السكتش",
|
||||
"configDialog2": "اذا قمت باختيار لوحة فقط ستسطيع ان تترجم لكن بدون ان ترفع المشروع",
|
||||
"couldNotFindPreviouslySelected": "تعذر ايجاد اللوحة '{0}' المختارة مسبقا في المنصة المثبتة '{1}' . الرجاء اعادة اختيار اللوحة التي تريد استعمالها يدويا . هل تريد باعادة الاختيار الان؟",
|
||||
"editBoardsConfig": "Edit Board and Port...",
|
||||
"editBoardsConfig": "تعديل اللوحة و المنفذ",
|
||||
"getBoardInfo": "الحصول على معلومات اللوحة",
|
||||
"inSketchbook": "(داخل ملف المشاريع)",
|
||||
"installNow": "نواة \"{0} {1}\" يجب تثبيتها للوحة \"{2}\" التي تم اختيارها . هل تريد تثبيتها الان ؟",
|
||||
@@ -32,7 +32,7 @@
|
||||
"ports": "منافذ",
|
||||
"programmer": "المبرمجة",
|
||||
"reselectLater": "اعد الاختيار لاحقا",
|
||||
"revertBoardsConfig": "Use '{0}' discovered on '{1}'",
|
||||
"revertBoardsConfig": "استخدم '{0}' تعامل مع '{1}'",
|
||||
"searchBoard": "أبحث عن متحكم",
|
||||
"selectBoard": "اختر لوحة",
|
||||
"selectPortForInfo": "الرجاء اختيار منفذ من اجل الحصول على معلومات اللوحة",
|
||||
@@ -41,7 +41,7 @@
|
||||
"succesfullyInstalledPlatform": "تم تثبيت المنصة {0}:{1} بنجاح",
|
||||
"succesfullyUninstalledPlatform": "تم الغاء تثبيت المنصة {0}:{1} بنجاح",
|
||||
"typeOfPorts": "المنافذ {0}",
|
||||
"unconfirmedBoard": "Unconfirmed board",
|
||||
"unconfirmedBoard": "اللوحة غير مدعومة",
|
||||
"unknownBoard": "لوحة غير معروفة"
|
||||
},
|
||||
"boardsManager": "مدير اللوحة",
|
||||
@@ -139,6 +139,7 @@
|
||||
"installManually": "ثبّت يدويا",
|
||||
"later": "لاحقا",
|
||||
"noBoardSelected": "لم يتم اختيار اي لوحة",
|
||||
"noSketchOpened": "No sketch opened",
|
||||
"notConnected": "[غير متصل]",
|
||||
"offlineIndicator": "انت غير متصل بالانترنت على الارجح , بدون الاتصال بالانترنت لن تستطيع واجهة سطر الاوامر الخاصة بالاردوينو \"Arduino CLI\" تحميل الموارد المطلوبة و من الممكن ان تسبب باخطاء , الرجاء الاتصال بالانترنت و اعادة تشغيل البرنامج",
|
||||
"oldFormat": "ال '{0}' ما زالت تستخدم صيغة `.pde` القديمة . هل تريد الانتقال الى صيغة `.ino` الجديدة ؟",
|
||||
@@ -146,6 +147,7 @@
|
||||
"processing": "تتم المعالجة",
|
||||
"recommended": "يُنصح به",
|
||||
"retired": "متقاعد",
|
||||
"selectManually": "Select Manually",
|
||||
"selectedOn": "{0} شغّل",
|
||||
"serialMonitor": "مراقب المنفذ التسلسلي \"سيريال بورت\"\n ",
|
||||
"type": "النوع",
|
||||
@@ -209,14 +211,16 @@
|
||||
"debug": {
|
||||
"debugWithMessage": "تصحيح برمجي - {0}",
|
||||
"debuggingNotSupported": "'{0}' لا يقبل التصحيح البرمجي",
|
||||
"getDebugInfo": "Getting debug info...",
|
||||
"noPlatformInstalledFor": "المنصة غير مثبتة ل '{0}'",
|
||||
"noProgrammerSelectedFor": "No programmer selected for '{0}'",
|
||||
"optimizeForDebugging": "التحسين من اجل التصحيح البرمجي",
|
||||
"sketchIsNotCompiled": "المشروع '{0}' يجب ان يتم التحقق منه قبل بدء جلسة تصحيح الاخطاء . الرجاء التحقق من المشروع و اعادة تشغيل مصحح الاخطاء مرة اخرى .\nهل تريد التحقق من المشروع الان؟"
|
||||
},
|
||||
"developer": {
|
||||
"clearBoardList": "Clear the Board List History",
|
||||
"clearBoardsConfig": "Clear the Board and Port Selection",
|
||||
"dumpBoardList": "Dump the Board List"
|
||||
"clearBoardList": "أمسح سجل قائمة اللوحة",
|
||||
"clearBoardsConfig": "إزالة تحديد المنفذ و اللوحة المحددة",
|
||||
"dumpBoardList": "تفريغ قائمة اللوحة"
|
||||
},
|
||||
"dialog": {
|
||||
"dontAskAgain": "لا تسأل مرة اخرى"
|
||||
@@ -250,7 +254,7 @@
|
||||
"selectBoard": "اختر لوحة",
|
||||
"selectVersion": "اختر نسخة البرامج الثابتة",
|
||||
"successfullyInstalled": "تم تثبيت البرامج الثابتة بنجاح",
|
||||
"updater": "Firmware Updater"
|
||||
"updater": "تحديث البرنامج"
|
||||
},
|
||||
"help": {
|
||||
"environment": "البيئة",
|
||||
@@ -381,11 +385,12 @@
|
||||
"invalid.editorFontSize": "حجم خط المحرّر غير صالح . يجب ان يكون عدد موجب",
|
||||
"invalid.sketchbook.location": "موقع ملف المشروع غير صالح : {0}",
|
||||
"invalid.theme": "سمة غير صالحة",
|
||||
"language.asyncWorkers": "Number of async workers used by the Arduino Language Server (clangd). Background index also uses this many workers. The minimum value is 0, and the maximum is 8. When it is 0, the language server uses all available cores. The default value is 0.",
|
||||
"language.log": "\"True\" اذا كان مخدم اللغات الخاص بArduino يستطيع توليد سجلات الى ملف المشروع , و الا \"False\", و هي كذلك بشكل افتراضي.",
|
||||
"language.realTimeDiagnostics": "اذا تم تفعيله , سيقوم سيرفر اللغة باعطاء تشخيصات للاخطاء خلال الوقت الحقيقي اثناء الكتابة ضمن المحرر . غير مفعل بشكل افتراضي",
|
||||
"manualProxy": "اعدادات الوكيل يدوياً",
|
||||
"monitor": {
|
||||
"dockPanel": "The area of the application shell where the _{0}_ widget will reside. It is either \"bottom\" or \"right\". It defaults to \"{1}\"."
|
||||
"dockPanel": "منطقة التطبيق هي _{0}_ حيث سيتم وضع عنصر واجهة المستخدم. إنها إما \"أسفل\" أو \"يمين\". الأفتراضي هو \"{1}\""
|
||||
},
|
||||
"network": "شبكة",
|
||||
"newSketchbookLocation": "اختر مكان المشروع الجديد",
|
||||
@@ -460,6 +465,8 @@
|
||||
"saveSketchAs": "حفظ ملف المشروع باسم ...",
|
||||
"showFolder": "اعرض ملف المشروع",
|
||||
"sketch": "مشروع",
|
||||
"sketchAlreadyContainsThisFileError": "The sketch already contains a file named '{0}'",
|
||||
"sketchAlreadyContainsThisFileMessage": "Failed to save sketch \"{0}\" as \"{1}\". {2}",
|
||||
"sketchbook": "مجلد المشاريع",
|
||||
"titleLocalSketchbook": "مجلد المشاريع المحلي",
|
||||
"titleSketchbook": "مجلد المشاريع",
|
||||
|
||||
@@ -139,6 +139,7 @@
|
||||
"installManually": "Əl ilə yüklə",
|
||||
"later": "Later",
|
||||
"noBoardSelected": "No board selected",
|
||||
"noSketchOpened": "No sketch opened",
|
||||
"notConnected": "[not connected]",
|
||||
"offlineIndicator": "You appear to be offline. Without an Internet connection, the Arduino CLI might not be able to download the required resources and could cause malfunction. Please connect to the Internet and restart the application.",
|
||||
"oldFormat": "The '{0}' still uses the old `.pde` format. Do you want to switch to the new `.ino` extension?",
|
||||
@@ -146,6 +147,7 @@
|
||||
"processing": "Processing",
|
||||
"recommended": "Recommended",
|
||||
"retired": "Retired",
|
||||
"selectManually": "Select Manually",
|
||||
"selectedOn": "on {0}",
|
||||
"serialMonitor": "Serial Monitor",
|
||||
"type": "Type",
|
||||
@@ -209,7 +211,9 @@
|
||||
"debug": {
|
||||
"debugWithMessage": "Debug - {0}",
|
||||
"debuggingNotSupported": "Debugging is not supported by '{0}'",
|
||||
"getDebugInfo": "Getting debug info...",
|
||||
"noPlatformInstalledFor": "Platform is not installed for '{0}'",
|
||||
"noProgrammerSelectedFor": "No programmer selected for '{0}'",
|
||||
"optimizeForDebugging": "Optimize for Debugging",
|
||||
"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?"
|
||||
},
|
||||
@@ -381,6 +385,7 @@
|
||||
"invalid.editorFontSize": "Invalid editor font size. It must be a positive integer.",
|
||||
"invalid.sketchbook.location": "Invalid sketchbook location: {0}",
|
||||
"invalid.theme": "Invalid theme.",
|
||||
"language.asyncWorkers": "Number of async workers used by the Arduino Language Server (clangd). Background index also uses this many workers. The minimum value is 0, and the maximum is 8. When it is 0, the language server uses all available cores. The default value is 0.",
|
||||
"language.log": "True if the Arduino Language Server should generate log files into the sketch folder. Otherwise, false. It's false by default.",
|
||||
"language.realTimeDiagnostics": "If true, the language server provides real-time diagnostics when typing in the editor. It's false by default.",
|
||||
"manualProxy": "Manual proxy configuration",
|
||||
@@ -460,6 +465,8 @@
|
||||
"saveSketchAs": "Save sketch folder as...",
|
||||
"showFolder": "Show Sketch Folder",
|
||||
"sketch": "Sketch",
|
||||
"sketchAlreadyContainsThisFileError": "The sketch already contains a file named '{0}'",
|
||||
"sketchAlreadyContainsThisFileMessage": "Failed to save sketch \"{0}\" as \"{1}\". {2}",
|
||||
"sketchbook": "Sketchbook",
|
||||
"titleLocalSketchbook": "Local Sketchbook",
|
||||
"titleSketchbook": "Sketchbook",
|
||||
|
||||
@@ -139,6 +139,7 @@
|
||||
"installManually": "Инсталирай ръчно",
|
||||
"later": "По-късно",
|
||||
"noBoardSelected": "Не е избрана платка",
|
||||
"noSketchOpened": "No sketch opened",
|
||||
"notConnected": "[няма връзка]",
|
||||
"offlineIndicator": "Изглежда, че сте офлайн. Без интернет връзка, Arduino CLI може да не успее да изтегли необходимите ресурси и може да причини неизправност. Моля, свържете се с интернет и рестартирайте приложението.",
|
||||
"oldFormat": "„{0}“ все още използва стария формат .pde. Искате ли да преминете към новото разширение `.ino`?",
|
||||
@@ -146,6 +147,7 @@
|
||||
"processing": "Обработва се",
|
||||
"recommended": "Recommended",
|
||||
"retired": "Retired",
|
||||
"selectManually": "Select Manually",
|
||||
"selectedOn": "на {0}",
|
||||
"serialMonitor": "Сериен Монитор",
|
||||
"type": "Type",
|
||||
@@ -209,7 +211,9 @@
|
||||
"debug": {
|
||||
"debugWithMessage": "Отстраняване на грешки - {0}",
|
||||
"debuggingNotSupported": "Отстраняването на грешки не се поддържа от „{0}“",
|
||||
"getDebugInfo": "Getting debug info...",
|
||||
"noPlatformInstalledFor": "Платформата не е инсталирана за „{0}“",
|
||||
"noProgrammerSelectedFor": "No programmer selected for '{0}'",
|
||||
"optimizeForDebugging": "Оптимизиране за отстраняване на грешки",
|
||||
"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?"
|
||||
},
|
||||
@@ -381,6 +385,7 @@
|
||||
"invalid.editorFontSize": "Невалиден размер на шрифта на редактора. Трябва да е положително цяло число.",
|
||||
"invalid.sketchbook.location": "Невалидно местоположение на скицника: {0}",
|
||||
"invalid.theme": "Невалидна тема.",
|
||||
"language.asyncWorkers": "Number of async workers used by the Arduino Language Server (clangd). Background index also uses this many workers. The minimum value is 0, and the maximum is 8. When it is 0, the language server uses all available cores. The default value is 0.",
|
||||
"language.log": "True, ако езиковият сървър на Arduino трябва да генерира лог файлове в папката за скици. В противен случай false. По подразбиране е false.",
|
||||
"language.realTimeDiagnostics": "If true, the language server provides real-time diagnostics when typing in the editor. It's false by default.",
|
||||
"manualProxy": "Ръчна конфигурация на прокси",
|
||||
@@ -460,6 +465,8 @@
|
||||
"saveSketchAs": "Запазете папката със скици като...",
|
||||
"showFolder": "Показване на папка за скици",
|
||||
"sketch": "Скица",
|
||||
"sketchAlreadyContainsThisFileError": "The sketch already contains a file named '{0}'",
|
||||
"sketchAlreadyContainsThisFileMessage": "Failed to save sketch \"{0}\" as \"{1}\". {2}",
|
||||
"sketchbook": "Скицник",
|
||||
"titleLocalSketchbook": "Локален скицник",
|
||||
"titleSketchbook": "Скицник",
|
||||
|
||||
@@ -139,6 +139,7 @@
|
||||
"installManually": "Instal·la manualment",
|
||||
"later": "Més tard",
|
||||
"noBoardSelected": "No s'ha seleccionat cap placa",
|
||||
"noSketchOpened": "No sketch opened",
|
||||
"notConnected": "[no connectat]",
|
||||
"offlineIndicator": "Sembla que estàs fora de línia. Sense connexió a Internet, és possible que l'Arduino CLI no pugui descarregar els recursos necessaris i podria provocar un mal funcionament. Connecteu-vos a Internet i reinicieu l'aplicació.",
|
||||
"oldFormat": "El \"{0}\" encara utilitza l'antic format \".pde\". Voleu canviar a la nova extensió \".ino\"?",
|
||||
@@ -146,6 +147,7 @@
|
||||
"processing": "Processant",
|
||||
"recommended": "Recomanat",
|
||||
"retired": "Retirat",
|
||||
"selectManually": "Select Manually",
|
||||
"selectedOn": "sobre {0}",
|
||||
"serialMonitor": "Monitor sèrie",
|
||||
"type": "Tipus",
|
||||
@@ -209,7 +211,9 @@
|
||||
"debug": {
|
||||
"debugWithMessage": "Depuració - {0}",
|
||||
"debuggingNotSupported": "La depuració no és compatible amb '{0}'",
|
||||
"getDebugInfo": "Getting debug info...",
|
||||
"noPlatformInstalledFor": "La plataforma no està instal·lada per a '{0}'",
|
||||
"noProgrammerSelectedFor": "No programmer selected for '{0}'",
|
||||
"optimizeForDebugging": "Optimitzar per a la depuració",
|
||||
"sketchIsNotCompiled": "El programa \"{0}\" s'ha de comprovar abans de començar la depuració. Per favor, verifica el programa i comença a depurar de nou. Vols verificar el programa ara?"
|
||||
},
|
||||
@@ -381,6 +385,7 @@
|
||||
"invalid.editorFontSize": "Mida del tipus de lletra de l'editor no vàlida. Ha de ser un nombre enter positiu.",
|
||||
"invalid.sketchbook.location": "La ubicació del quadern de programes no és vàlida: {0}",
|
||||
"invalid.theme": "Tema no vàlid.",
|
||||
"language.asyncWorkers": "Number of async workers used by the Arduino Language Server (clangd). Background index also uses this many workers. The minimum value is 0, and the maximum is 8. When it is 0, the language server uses all available cores. The default value is 0.",
|
||||
"language.log": "És cert si el servidor d'idiomes Arduino hauria de generar fitxers de registre a la carpeta de programes. En cas contrari, fals. És fals per defecte.",
|
||||
"language.realTimeDiagnostics": "Si està activat, el servidor d'idiomes ofereix diagnòstics en temps real mentre s'escriu. Per defecte està desactivat.",
|
||||
"manualProxy": "Configuració manual del proxy",
|
||||
@@ -460,6 +465,8 @@
|
||||
"saveSketchAs": "Desa la carpeta del programa com a...",
|
||||
"showFolder": "Mostra la carpeta del programa",
|
||||
"sketch": "Programa",
|
||||
"sketchAlreadyContainsThisFileError": "The sketch already contains a file named '{0}'",
|
||||
"sketchAlreadyContainsThisFileMessage": "Failed to save sketch \"{0}\" as \"{1}\". {2}",
|
||||
"sketchbook": "Quadern de programes",
|
||||
"titleLocalSketchbook": "Quadern de programes local",
|
||||
"titleSketchbook": "Quadern de programes",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user