1048 Commits

Author SHA1 Message Date
Giacomo Cusinato
7dafe7b0d3
feat: use Arduino CLI 1.2.0 (#2645) 2025-03-28 17:53:46 +01:00
Giacomo Cusinato
859d29d41a
feat: use theia@1.57.0 (#2654) 2025-03-29 01:33:25 +09:00
Christian Sarnataro
d298b3ffc9
fix: sanitize message in notification component (#2664)
fix: sanitize messages in notification component
2025-03-24 12:42:48 +01:00
dankeboy36
5ec1915000
fix(plugin): decouple state update from the LS (#2643)
* fix(plugin): decouple state update from the LS

To enhance the reliability of Arduino IDE extensions, the update
process for `ArduinoState` has been modified to ensure independence
from the language server's availability. This change addresses issues
caused by `compileSummary` being `undefined` due to potential startup
failures of the Arduino Language Server, as noted in
https://github.com/dankeboy36/esp-exception-decoder/issues/28#issuecomment-2681800772.

The `compile` command now resolves with a `CompileSummary` rather than
`void`, facilitating a more reliable way for extensions to access
necessary data. Furthermore, the command has been adjusted to allow
resolution with `undefined` when the compiled data is partial.

By transitioning to direct usage of the resolved compile value for
state updates, the reliance on executed commands for extensions is
eliminated. This update also moves the VSIX command execution to the
frontend without altering existing IDE behavior.

Closes arduino/arduino-ide#2642

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

* fix: install missing libx11-dev and libxkbfile-dev

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

* fix: pick better GH step name

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

* fix: install the required dependencies on Linux

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

* fix(revert): do not manually install deps on Linux

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

* chore: pin `ubuntu-22.04` for linux actions

* fix: restore accidentally removed dispose on finally

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

* fix(test): align mock naming 💄

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

* fix: let the ino contribution notify the LS

+ event emitter dispatches the new state.

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

* fix(test): emit the new compiler summary state

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

* chore(revert): unpin linux version, use latest

revert of b11bde1c47

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

---------

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>
Co-authored-by: Giacomo Cusinato <7659518+giacomocusinato@users.noreply.github.com>
2025-03-10 15:20:22 +07:00
Per Tillisch
6d96e227eb Bump built-in example sketches version to 1.10.2
The Arduino IDE installation includes a collection of example sketches demonstrating fundamental concepts.

These examples are hosted in a dedicated repository, which is a dependency of this project. A new release has been made
in that `arduino/arduino-examples` repository.

The infrastructure for downloading the examples during the Arduino IDE build is hereby updated to use the latest release
of the `arduino/arduino-examples` repository.
2025-02-28 06:56:33 -08:00
Giacomo Cusinato
6eef09efd8
chore: switch to version 2.3.5 after the release (#2587)
To produce a correctly versioned nightly build.
See the [docs](1b9c7e93e0/docs/internal/release-procedure.md (7-%EF%B8%8F-bump-version-metadata-of-packages)) for more details.
2024-12-03 13:21:25 +01:00
Giacomo Cusinato
8e18c47d30 feat: use dompurify to sanitize translations
Pin same version of `dompurify` used in Theia
2024-12-02 15:21:22 +01:00
Giacomo Cusinato
4788bfbc3f feat: introduce VersionWelcomeDialog
Show donate dialog after the first time a first IDE version is loaded
2024-12-02 15:21:22 +01:00
Giacomo Cusinato
71b11ed829 feat: add donate footer to updater dialog 2024-12-02 15:21:22 +01:00
Giacomo Cusinato
de265694ee feat: use Arduino CLI v1.1.1 2024-11-27 14:05:16 +01:00
Giacomo Cusinato
8462d8a391 refactor: generate-protocol now fetch proto files from arduino_cli_{version}_proto.zip
- Use the CLI release proto.zip to get proto files for production versions of CLI
- Extract the proto files from repo if CLI version is declared as `commitsh` or version is 1.1.0

See https://github.com/arduino/arduino-cli/pull/2761
2024-11-27 14:05:16 +01:00
dankeboy36
48d6d37539 feat: can skip verify before upload
Adds a new preference to control whether the
verify command should automatically run before the
upload. If the `arduino.upload.autoVerify` setting
value is `false`, IDE does not recompile the
sketch code before uploading it to the board.

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>
2024-11-26 21:41:48 +01:00
Giacomo Cusinato
d1065886ef feat: use Arduino CLI 1.1.0 2024-11-21 14:21:30 +01:00
Giacomo Cusinato
8773bd67ab fix: use missing google proto files in CLI 2024-11-21 14:21:30 +01:00
dankeboy36
3fc8474d71
fix: align viewsWelcome behavior to VS Code (#2543)
* fix: align `viewsWelcome` behavior to VS Code

Ref: eclipse-theia/theia#14309
Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

* fix: update change proposal from Theia as is

Ref: arduino/arduino-ide#2543
Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

---------

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>
2024-11-21 08:43:04 +01:00
Giacomo Cusinato
4cf9909a07
fix: retry compilation if grpc client needs to be reinitialized (#2548)
* fix: use `Status` enum for status code in `ServiceError` type guards

This change resolves the issue where the intersection of `ServiceError` error codes of type `number` resulted in the `never` type due to conflict between number and `State` enum if `StatusObject`

* feat: add `isInvalidArgument` type guard to `ServiceError`

* fix: retry compilation if grpc client needs to be reinitialized

See https://github.com/arduino/arduino-ide/issues/2547
2024-11-21 08:42:14 +01:00
Giacomo Cusinato
41844c9470
feat: implement menu action to reload current board data (#2553) 2024-11-21 08:41:26 +01:00
Giacomo Cusinato
7c231fff76
fix: memory leak when scanning sketchbooks with large files (#2555)
Resolves https://github.com/arduino/arduino-ide/issues/2537

Fix memory leak issue caused by inflight dependency, see https://github.com/isaacs/node-glob/issues/435
2024-11-21 08:40:52 +01:00
per1234
d377d00042 Use appropriate equality operator in changelog script
It is considered good practice to use JavaScript's type-safe strict equality operator === instead of the equality
operator ==. Compliance with this practice is enforced by the project's ESLint configuration, via the "eqeqeq" rule.

The script used to generate the changelog for Arduino IDE's auto-update dialog contained an inappropriate usage of the
equality operator. This caused linting runs to fail:

arduino-ide-extension/scripts/compose-changelog.js
  37:19  error  Expected '===' and instead saw '=='  eqeqeq
2024-11-19 03:53:36 -08:00
per1234
f232010bec Correct eslint command in lint script
The `lint` script of the "arduino-ide-extension" package is intended to use the ESLint linter tool to check for problems
in all the package's JavaScript and TypeScript code files. It is used by the continuous integration system to validate
contributions.

Previously, the command invoked `eslint` without any arguments. With the 8.x version of ESLint used by the project, it
is necessary to provide a path argument in order to cause it to lint the contents of files. Because that argument was
not provided, the script didn't do anything at all and so would return a 0 exit status even if the code had linting rule
violations.

This is fixed by adding a `.` path argument to the command invoked by the script. This will cause ESLint to recurse
through the `arduino-ide-extension` folder and lint the code in all relevant files.
2024-11-19 03:53:36 -08:00
Giacomo Cusinato
4a3abf542c fix: prevent parsing CLI errors without metadata
When parsing a CLI error, check if any metadata from grpc is present before trying to parse it.
Closes #2516
2024-10-22 09:06:28 -07:00
per1234
91bb75ca97 Bump version metadata post release
On every startup, Arduino IDE checks for new versions of the IDE. If a newer version is available, a notification/dialog
is shown offering an update.

"Newer" is determined by comparing the version of the user's IDE to the latest available version on the update channel.
This comparison is done according to the Semantic Versioning Specification ("SemVer").

In order to facilitate beta testing, builds are generated of the Arduino IDE at the current stage in development. These
builds are given an identifying version of the following form:

- <version>-snapshot-<short hash> - builds generated for every push and pull request that modifies relevant files
- <version>-nightly-<YYYYMMDD> - daily builds of the tip of the default branch

In order to cause these builds to be correctly considered "newer" than the release version, the version metadata must be
bumped immediately following each release.

This will also serve as the metadata bump for the next release in the event that release is a minor release. In case it
is instead a minor or major release, the version metadata will need to be updated once more before the release tag is
created.
2024-10-22 07:52:48 -07:00
Giacomo Cusinato
a5bf56ffa6 feat: upload using programmer by default if board requires it 2024-09-19 11:57:42 +02:00
Giacomo Cusinato
2de8bd1717 feat: decode grpc status objects and map them to protocol types
Status object thrown by grpc commands contains metadata that needs to be serialized in order to map it to custom errors generated through proto files https://github.com/grpc/grpc-web/issues/399
2024-09-19 11:57:42 +02:00
Giacomo Cusinato
1ec0a8cc77
feat: use Arduino CLI 1.0.4 (#2457)
* fix: use `@pingghost/protoc` to compile proto files

The npm package previously used (`protoc`) is still lacking apple arm32 support, see https://github.com/YePpHa/node-protoc/pull/10

* feat: use Arduino CLI 1.0.4

* fix: allow use of node16 in github actions

* chore: update `arduino-language-server` version for cli-1.0.0

* fix: deprecated platform order test

Arduino deprecated platforms should have more priority then other deprecated ones
2024-09-06 11:38:55 +02:00
Giacomo Cusinato
c3adde5460
feat: add shared space support (#2486) 2024-09-06 10:29:31 +02:00
Akos Kitta
aa9b10d68e fix: copy example with .pde main sketch file
Closes arduino/arduino-ide#2377

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-22 16:19:10 +01:00
Akos Kitta
4217c0001d fix: add missing installed version to the platform
Closes arduino/arduino-ide#2378

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-21 17:01:28 +01:00
Akos Kitta
a088ba99f5 fix: invalid custom board option handling in FQBN
Closes arduino/arduino-ide#1588

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-20 13:38:52 +01:00
Akos Kitta
2a325a5b74 feat: cancelable verify+upload
Closes arduino/arduino-ide#1199

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-20 13:38:52 +01:00
Akos Kitta
347e3d8118 fix: can unset network#proxy in the CLI config
An empty object (`{}`) must be used to correctly unset the CLI config
value to its default.

Closes arduino/arduino-ide#2184

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-20 13:38:52 +01:00
Akos Kitta
8e09971078 feat: use Arduino CLI 0.36.0-rc.1 APIs
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-20 13:38:52 +01:00
Akos Kitta
48e7bf6b5d chore: switch to version 2.3.3 after the release
To produce a correctly versioned nightly build.
See the [docs](1b9c7e93e0/docs/internal/release-procedure.md (7-%EF%B8%8F-bump-version-metadata-of-packages)) for more details.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-20 12:55:39 +01:00
Akos Kitta
4a807ab538 fix: no required programmer for debug --info
Ref: arduino/arduino-cli#2540
Closes: arduino/arduino-ide#2368

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-19 17:37:27 +01:00
Akos Kitta
547a630598 chore: switch to version 2.3.2 after the release
To produce a correctly versioned nightly build.
See the [docs](1b9c7e93e0/docs/internal/release-procedure.md (7-%EF%B8%8F-bump-version-metadata-of-packages)) for more details.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-15 10:27:29 +01:00
Akos Kitta
ca779e5cf2 fix: debug widget layout updates
Use customized `PanelLayout#removeWidget` and
`PanelLayout#insertWidget` logic for the layout
updates. The customized functions ensure no side
effect if adding/removing the widget to/from the
layout but it's already present/absent.

Unlike the default [`PanelLayout#removeWidget`](9f5e11025b/packages/widgets/src/panellayout.ts (L154-L156))
behavior, do not try to remove the widget if it's
not present (has a negative index). Otherwise,
required widgets might be removed based on the
default [`ArrayExt#removeAt`](9f5e11025b/packages/algorithm/src/array.ts (L1075-L1077))
behavior.

Closes: arduino/arduino-ide#2354

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-08 14:17:10 +01:00
Akos Kitta
0822ed28da chore: switch to version 2.3.1 after the release
To produce a correctly versioned nightly build.
See the [docs](1b9c7e93e0/docs/internal/release-procedure.md (7-%EF%B8%8F-bump-version-metadata-of-packages)) for more details.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-07 19:05:11 +01:00
Akos Kitta
1b9c7e93e0 chore: use version 2.3.0 for the next release
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-07 13:09:34 +01:00
Akos Kitta
d419a6c6f0 feat: preference to limit thread count of the LS
Added a new preference (`arduino.language.asyncWorkers`) to control the
number of async workers used by `clangd`.
Users can fine tune the `clangd` thread count to overcome the excessive
CPU usage.

Use 0.1.2 Arduino Tools VSIX in IDE2.

Ref: arduino/arduino-language-server#177
Ref: arduino/vscode-arduino-tools#46

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-02-07 12:28:57 +01:00
Akos Kitta
763fde036c feat: disable debug widget if unsupported by board
Remove the 'Add configuration...' select option from the debug widget.

Closes #14

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-01-31 12:04:29 +01:00
per1234
0e7b0c9486 Bundle native Arduino Firmware Uploader with Apple Silicon build
A separate build of Arduino IDE is produced for each of the macOS host architectures:

* Apple Silicon (ARM)
* Intel (x86)

The Arduino IDE distribution includes several bundled helper tools. The build of those tools should also be selected according to the target host architecture.

At the time the infrastructure was set up for bundling the "Arduino Firmware Uploader" tool with the Arduino IDE distribution, that tool was only produced in a macOS x86 variant. So this was used even in the Apple Silicon Arduino IDE distribution, relying on Rosetta 2 to provide compatibility when used on Apple Silicon machines. Since that time, the Arduino Firmware Uploader build infrastructure has been updated to produce an Apple Silicon build of the tool and such a build is available for the IDE's current version dependency of Arduino Firmware Updater.

The "Arduino Firmware Uploader" tool bundling script is hereby updated to use the most appropriate variant of the dependency for the target host architecture. This provides the following benefits

* Compatibility with systems that don't have Rosetta 2 installed
* Improved performance
2024-01-22 02:32:45 -08:00
Akos Kitta
b8dd39c729 chore: pinned Arduino CLI 0.35.1
Closes arduino/arduino-ide#2318

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-01-17 17:30:25 +01:00
per1234
2f2b19f613 Bump built-in example sketches version to 1.10.1
The Arduino IDE installation includes a collection of example sketches demonstrating fundamental concepts.

These examples are hosted in a dedicated repository, which is a dependency of this project. A new release has been made
in that `arduino/arduino-examples` repository.

The infrastructure for downloading the examples during the Arduino IDE build is hereby updated to use the latest release
of the `arduino/arduino-examples` repository.
2024-01-15 00:40:18 -08:00
Akos Kitta
0ca1a31747 fix: board <select> update on board detach
When the previously selected board is not detected, unset the `<select>`
option.

Closes #2222

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-01-15 09:25:10 +01:00
Akos Kitta
d01f95647e fix: sketch Save As errors on name collision
The Save As operation is halted and the problem clearly communicated to
the user when there is a collision between the target primary source
file name and existing secondary source files of the sketch.

Closes #827

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-01-15 09:24:50 +01:00
Akos Kitta
074f654457 fix: sketch Save As preserves the folder structure
This commit rewrites how IDE copies sketches as part of the _Save As_
operation. Instead of copying to the destination, IDE copies the sketch
into a temporary location, then to the desired destination.

This commit drops [`cpy`](https://www.npmjs.com/package/cpy).
Ref: 47b89a70b5

Closes #2077

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-01-15 09:24:50 +01:00
Akos Kitta
3eef857b48 fix: can open IDE from an ino file
Use a fallback frontend app config when starting IDE2 from an ino file
(from Explorer, Finder, etc.) and the app config is not yet set.

Closes #2209

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2024-01-15 09:16:11 +01:00
Akos Kitta
73b6dc4774 feat: use new debug -I -P CLI output
- Can pick a programmer if missing,
 - Can auto-select a programmer on app start,
 - Can edit the `launch.json`,
 - Adjust board discovery to new gRPC API. From now on, it's a client
 read stream, not a duplex.
 - Allow `.cxx` and `.cc` file extensions. (Closes #2265)
 - Drop `debuggingSupported` from `BoardDetails`.
 - Dedicated service endpoint for checking the debugger.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-12-13 17:32:07 +01:00
Akos Kitta
42bf1a0e99 test: test Arduino state update for extensions
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-12-13 17:32:07 +01:00
Akos Kitta
5abdc18fcc fix: make hosted plugin support testable
Hide the concrete implementation behind an interface so that tests can
`require` it.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-12-13 17:32:07 +01:00