From 960d8dba2efdc61b331d7799d3c1cd909fc6213c Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Wed, 12 Aug 2020 15:40:32 +0200 Subject: [PATCH] removed that uses a more recent version of the CLI from the PATH from now on, we always use the one from the IDE. Documented how to replace it on demand. Signed-off-by: Akos Kitta --- README.md | 11 +++++++++++ arduino-ide-extension/src/node/arduino-daemon-impl.ts | 2 +- .../language/arduino-language-server-contribution.ts | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d191ad4..48f0d367 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,17 @@ This project is built on [GitHub Actions](https://github.com/bcmi-labs/arduino-e git push origin 1.2.3 ``` +### FAQ + + - Q: Can I manually change the version of the [`arduino-cli`](https://github.com/arduino/arduino-cli/) used by the IDE? + - A: Yes. It is possible but not recommended. The CLI exposes a set of functionality via [gRPC](https://github.com/arduino/arduino-cli/tree/master/rpc) and the IDE uses this API to communicate with the CLI. Before we build a new version of IDE, we pin a specific version of CLI and use the corresponding `proto` files to generate TypeScript modules for gRPC. This means, a particular version of IDE is compliant only with the pinned version of CLI. Mismatching IDE and CLI versions might not be able to communicate with each other. This could cause unpredictable IDE behavior. + + - Q: I have understood that not all versions of the CLI is compatible with my version of IDE but how can I manually update the `arduino-cli` inside the IDE? + - A: [Get](https://arduino.github.io/arduino-cli/installation) the desired version of `arduino-cli` for your platform and manually replace the one inside the IDE. The CLI can be found inside the IDE at: + - Windows: `C:\path\to\Arduino Pro IDE\resources\app\node_modules\arduino-ide-extension\build\arduino-cli.exe`, + - macOS: `/path/to/Arduino Pro IDE.app/Contents/Resources/app/node_modules/arduino-ide-extension/build/arduino-cli`, and + - Linux: `/path/to/Arduino Pro IDE/resources/app/node_modules/arduino-ide-extension/build/arduino-cli`. + ### Architecture overview The Pro IDE consists of three major parts: diff --git a/arduino-ide-extension/src/node/arduino-daemon-impl.ts b/arduino-ide-extension/src/node/arduino-daemon-impl.ts index 48313e37..a4f59065 100644 --- a/arduino-ide-extension/src/node/arduino-daemon-impl.ts +++ b/arduino-ide-extension/src/node/arduino-daemon-impl.ts @@ -133,7 +133,7 @@ export class ArduinoDaemonImpl implements ArduinoDaemon, BackendApplicationContr if (this._execPath) { return this._execPath; } - this._execPath = await getExecPath('arduino-cli', this.onError.bind(this), 'version'); + this._execPath = await getExecPath('arduino-cli', this.onError.bind(this)); return this._execPath; } diff --git a/arduino-ide-extension/src/node/language/arduino-language-server-contribution.ts b/arduino-ide-extension/src/node/language/arduino-language-server-contribution.ts index 8377acf9..302fe4bc 100644 --- a/arduino-ide-extension/src/node/language/arduino-language-server-contribution.ts +++ b/arduino-ide-extension/src/node/language/arduino-language-server-contribution.ts @@ -30,7 +30,7 @@ export class ArduinoLanguageServerContribution extends BaseLanguageServerContrib const [languageServer, clangd, cli] = await Promise.all([ getExecPath('arduino-language-server', this.onError.bind(this)), getExecPath('clangd', this.onError.bind(this), '--version', os.platform() !== 'win32'), - getExecPath('arduino-cli', this.onError.bind(this), 'version') + getExecPath('arduino-cli', this.onError.bind(this)) ]); // Add '-log' argument to enable logging to files const args: string[] = ['-clangd', clangd, '-cli', cli];