Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@
"package-version": "2.20.1",
"version": "https://github.com/pioarduino/registry/releases/download/0.0.1/cppcheck-v2.20.1.zip"
},
"tool-clangd-esp": {
"type": "tool",
"optional": true,
"owner": "pioarduino",
"package-version": "21.1.3+20260304",
"version": "https://github.com/pioarduino/registry/releases/download/0.0.1/clangd-esp-21.1.3_20260304.zip"
},
"tool-clangtidy": {
"type": "tool",
"optional": true,
Expand Down
14 changes: 14 additions & 0 deletions platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,19 @@ def _configure_check_tools(self, variables: Dict) -> None:
if any(tool in package for tool in check_tools):
self.install_tool(package)

def _configure_clangd_tool(self) -> None:
"""Install Espressif's clangd when the IDE has clangd IntelliSense enabled.

The pioarduino IDE extension exports PLATFORMIO_IDE_INTELLISENSE_ENGINE
so the platform can automatically install the matching tool package.
Espressif's clangd has native Xtensa and ESP RISC-V support that the
upstream clangd lacks.
"""
engine = os.environ.get("PLATFORMIO_IDE_INTELLISENSE_ENGINE", "").strip().lower()
if engine == "clangd" and "tool-clangd-esp" in self.packages:
logger.info("clangd IntelliSense engine detected, installing tool-clangd-esp")
self.install_tool("tool-clangd-esp")

def _handle_dfuutil_tool(self, variables: Dict) -> None:
"""Install dfuutil tool for Arduino Nano ESP32 board."""
board_config = self.board_config(variables.get("board"))
Expand Down Expand Up @@ -851,6 +864,7 @@ def configure_default_packages(self, variables: Dict, targets: List[str]) -> Any

self._configure_rom_elfs_for_exception_decoder(variables)
self._configure_check_tools(variables)
self._configure_clangd_tool()
self._handle_dfuutil_tool(variables)

logger.info("Package configuration completed successfully")
Expand Down