Make the Arduino state update (for extensions) independent of the language server availability #2642
Closed
3 tasks done
Labels
type: enhancement
Proposed improvement
Describe the request
To enhance the reliability of Arduino IDE extensions, IDE needs to ensure that the Arduino state updates are independent of the language server's availability.
As highlighted at dankeboy36/esp-exception-decoder#28 (comment), the
compileSummary
of theArduinoState
may beundefined
due to potential startup failures of the Arduino Language Server. This scenario can lead to issues for extensions developed for the Arduino IDE.To mitigate this issue, I propose decoupling the
ArduinoState
update process from the language server itself. Given that the compile summary is already accessible, IDE should modify thecompile
command to resolve with aCompileSummary
rather thanvoid
. Additionally, the compile command should be relaxed to resolve withundefined
when the data is partial.Instead of relying on executed commands to monitor the compile summary, IDE will directly use the resolved compile value to update the state for extensions. Furthermore, the frontend will dispatch the notification that a build has occurred directly from the frontend to the VS Code extension. This should help provide data for extensions reliably and not change the existing IDE behavior.
Describe the current behavior
IDE backend directly executes the command to update the build path after a verify:
arduino-ide/arduino-ide-extension/src/node/core-service-impl.ts
Line 184 in 6eef09e
IDE updates the
ArduinoState
after the successful command execution:arduino-ide/arduino-ide-extension/src/browser/contributions/update-arduino-state.ts
Lines 64 to 69 in 6eef09e
Arduino IDE version
2.3.4
Operating system
macOS
Operating system version
15.3.1
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: