I am trying to figure out how to get zephyr, platformio, and nrfconnect to work with clangd.
Platformio screams every second because Microsoft’s tooling is a dependency.
Zephyr and nrfconnect work for many things, but things like including drivers from zephyr/drivers doesn’t autofill which is annoying if you are searching for a driver that might exist in nrfconnect or might not because there are some differences. It also doesn’t autofill macros and device tree defines.
If anyone has a good guide on how to set up clangd for zephyr, I would appreciate it!
I am trying to figure out how to get zephyr, platformio, and nrfconnect to work with clangd.
Platformio screams every second because Microsoft’s tooling is a dependency.
Zephyr and nrfconnect work for many things, but things like including drivers from zephyr/drivers doesn’t autofill which is annoying if you are searching for a driver that might exist in nrfconnect or might not because there are some differences. It also doesn’t autofill macros and device tree defines.
If anyone has a good guide on how to set up clangd for zephyr, I would appreciate it!
Based on https://docs.zephyrproject.org/latest/develop/getting_started/index.html Zephyr seems to use cmake
So you should be able to use https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html to generate the compile commands json and configure clangd to use that.
Yeah, I have that set that via
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
but no compile_commands.json are actually output, sadly.