Skip to content

feat: auto-install tool-clangd-esp when IDE uses clangd IntelliSense#475

Merged
Jason2866 merged 1 commit into
esp_clangdfrom
feature/auto-install-clangd-esp
Apr 14, 2026
Merged

feat: auto-install tool-clangd-esp when IDE uses clangd IntelliSense#475
Jason2866 merged 1 commit into
esp_clangdfrom
feature/auto-install-clangd-esp

Conversation

@Jason2866
Copy link
Copy Markdown

Summary

The pioarduino IDE extension now exports PLATFORMIO_IDE_INTELLISENSE_ENGINE as an environment variable (via patchOSEnviron()). When its value is clangd, the platform automatically installs the tool-clangd-esp package during configure_default_packages().

How it works

IDE Extension (patchOSEnviron)
  │
  └─ sets PLATFORMIO_IDE_INTELLISENSE_ENGINE=clangd
       │
       └─ platform.py (configure_default_packages)
            │
            └─ _configure_clangd_tool()
                 │
                 └─ reads env var → installs tool-clangd-esp

The IDE extension then detects the installed binary at packages/tool-clangd-esp/esp-clangd/bin/clangd and sets clangd.path accordingly.

Why

Espressif's clangd has native Xtensa and ESP RISC-V ISA extension support (xespv, xesploop, xespdsp, etc.) that the upstream clangd lacks. This eliminates unknown-flag errors and greatly improves IntelliSense for all ESP32 targets.

Changes

  • platform.py: Added _configure_clangd_tool() method and call in configure_default_packages()
  • Companion IDE change: src/main.js in pioarduino-vscode-ide sets the env var

The pioarduino IDE extension now exports PLATFORMIO_IDE_INTELLISENSE_ENGINE
as an environment variable. When the value is 'clangd', the platform
automatically installs tool-clangd-esp during configure_default_packages().

Espressif's clangd has native Xtensa and ESP RISC-V ISA extension support
(xespv, xesploop, xespdsp, etc.) that the upstream clangd lacks, which
eliminates unknown-flag errors and improves IntelliSense for ESP32 targets.

Amp-Thread-ID: https://ampcode.com/threads/T-019d8c25-963a-728c-8166-76efd9747d60
Co-authored-by: Amp <amp@ampcode.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 50d6ea8b-b2c6-4112-b1dc-8ed3b0202c9b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/auto-install-clangd-esp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Jason2866 Jason2866 merged commit 6455529 into esp_clangd Apr 14, 2026
1 check passed
@Jason2866 Jason2866 deleted the feature/auto-install-clangd-esp branch April 14, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant