- VS Code extension with a Vue webview UI.
- Extension backend lives in
src/and is compiled tobuild/extension.js. - Webview app lives in
vue_webview/and is built tovue_webview/dist/.
src/extension.ts: activation, commands, status bar, wiring.src/VueWebviewPanel.ts: webview creation + message handling.src/shared/messages.ts: shared types andARDUINO_MESSAGESconstants (source of truth).src/ArduinoProject.ts: project config persisted in.vscode/arduino.json.src/cli.ts/src/cliArgs.ts: arduino-cli integration and build path logic.src/sketchProfileManager.ts:sketch.yamlbuild profiles.vue_webview/src/stores/useVsCodeStore.ts: message dispatch + webview state.vue_webview/src/components/OtherTools.vue: external tools UI.vue_webview/src/components/LibExamples.vue: library examples UI (sorted list + sorted examples).vue_webview/src/components/BoardExamples.vue: board examples UI (sorted list + sorted examples).src/cliOutputView.ts: Arduino CLI Output webview panel (search/filter, colorized output).
- Extension build:
npm run compile(producesbuild/extension.jsvia Vite). - Webview build:
npm run build:vue(producesvue_webview/dist/). - Prepublish:
npm run vscode:prepublish(builds both). - Lint:
npm run lint - Tests:
npm run test - Avoid editing generated outputs in
build/orvue_webview/dist/.
- Webview -> extension:
useVsCodeStore.sendMessage()postsARDUINO_MESSAGES. - Extension -> webview:
VueWebviewPanel.sendMessage(). - Any new message should be defined in
src/shared/messages.tsand handled on both sides.
- Fetch path:
BoardExamples.vue->ARDUINO_MESSAGES.CLI_BOARD_EXAMPLES->VueWebviewPanel->ArduinoCLI.searchBoardExamples()->arduino-cli lib list --all. - Filtering happens in the extension (
src/cli.ts), not the UI, so board/library caches stay separate. - FQBN respects build profiles:
ArduinoCLI.getBoardFqbnForExamples()selects profile FQBN when active and passes it to CLI args. - UI label shows
library.container_platformas "Examples from: ...";container_platformis part ofLibraryinsrc/shared/messages.ts.
- Uses
cli_libraryInstalledoutput; no server-side filtering. - UI sorts libraries and example lists alphabetically.
- Home upload port is disabled when build profiles are active (profiles manage port).
- Port selection sync is debounced to avoid overriding user choices during refresh; monitor port is kept in sync with upload port in
ArduinoProject.setPort.
- Build invalidation happens on editor changes and filesystem changes (including git pulls) via file watchers in
src/extension.ts. - Upload checks build freshness:
ArduinoProject.isUploadReady()comparescompile_result.jsonmtime to latest source mtime.
- Default build output is
build/at workspace root. - With active profiles, build output is
build/build_<profile>. partitions.csvis generated into the build output and used by the ESP32 Partition Builder URL.
- Base URL is centralized in
ESP32_PARTITION_BUILDER_BASE_URL(src/shared/messages.ts). VueWebviewPanelresolvespartitions.csv, flash size, and builds the URL.- Webview mock data should use the same base URL constant.
- If you add new settings or message types, update both the extension and webview.
- Keep ASCII when editing files unless the file already contains Unicode.