929 Commits

Author SHA1 Message Date
Dave Simpson
a3b0b28db4 remove unused class 2025-04-04 23:25:43 +02:00
Dave Simpson
62ca431cba try object instead of error 2025-04-04 23:20:29 +02:00
Dave Simpson
9c80246603 use class variable to identify custom error 2025-04-04 22:52:55 +02:00
Giacomo Cusinato
e36f393682
fix: prevent OutputWidget to gain focus when updated (#2681) 2025-04-03 17:51:30 +02:00
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
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
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
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
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
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
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
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
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
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
Akos Kitta
633346a3b0 feat: new window inherits the custom board options
A new startup task ensures setting any custom board menu selection in a
new sketch window.

Closes #2271

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-12-13 17:32:07 +01:00
Akos Kitta
64ce35edbb feat: show in tooltip if core is from sketchbook
Closes #2270

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-12-13 17:32:07 +01:00
Akos Kitta
153e34f11b chore(deps): update dependencies
To fix all security vulnerabilities detected by `Dependabot`.

 - remove `shelljs`. replace with `fs` and `console`.
 - remove `uuid`. replace with `@phosphor/coreutils`.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-10-13 08:50:39 +02:00
Akos Kitta
a8e63c8c90 test: relax accessible sketch path test condition
- Do not expect `EACCESS` on Linux.
 - Run the test only if `EACCESS` occurs via the `stat` syscall.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-10-09 19:24:51 +02:00
Akos Kitta
0b2410d49a
test: run cloud sketches tests on the CI (#2092)
- fix(test): integration tests are more resilient.
   - run the Create integration tests with other slow tests,
   - queued `PUT`/`DELETE` requests to make the test timeout happy,
   - reduced the `/sketches/search` offset to 1/5th and
   - remove Create API logging.
 - fix(linter): ignore `lib` folder. Remove obsolete `.node_modules`
pattern.
 - feat(ci): enable Create API integration tests.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Co-authored-by: per1234 <accounts@perglass.com>
2023-10-07 10:38:54 +02:00
Akos Kitta
57975f8d91
fix: use board+port at startup if it's restored (#2242)
- update status bar if board+port is restored,
 - refresh the debug toolbar if board+port is restored,
 - init `Include Library` if board+port is ready, and
 - init library examples if board+port is ready

Closes #2237
Closes #2239

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-10-05 14:41:14 +02:00
Akos Kitta
8f4bcc83ec
chore(deps): update to theia@1.41.0 (#2211)
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-09-29 18:40:13 +02:00
Akos Kitta
ce02e263ec fix: storage service injection
Store the board config data per sketch and not per IDE installation.

The (Theia) default `StorageService` implementation is workspace-scoped
when `@theia/workspace` is part of the final application.

Closes #2240

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-09-27 17:34:24 +02:00
Akos Kitta
8a5dee9307 chore: format resources 💄
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-09-26 10:06:47 +02:00
Akos Kitta
7f660d76a8 fix: refresh the user-fields at app startup
Ref: arduino/arduino-ide#2165
Closes arduino/arduino-ide#2230

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-09-26 09:57:02 +02:00
Akos Kitta
9f48296d4d fix: defer board+port state update for extensions
If it is set before the board+port settings are restored from the
`localStorage`, extensions will see no board+port.

Ref: arduino/arduino-ide#2165
Ref: dankeboy36/esp-exception-decoder#10

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
2023-09-26 09:56:34 +02:00