clangd support in extension

Hi,

I am trying to use the clangd extension with nRF Connect SDK, as it does a much better job than intellisense. I added 

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

To the top of my CMakeLists.txt, and symlinked compile_commands.json in the root of my project to <build dir>/application/compile_commands.json. This works great, however it doesn't update when switching between different build configurations. As far as I can see, there isn't any way to do that automatically, because there isn't any way to get the active build configuration from the nrf connect extension. One way to enable this would be to add a "active_build" action to task bindings, to enable the extension to trigger a task when switching active build. This would enable me to create a task to update the symlink or .clangd configuration and restart clangd. It would be great if the extension natively supported clangd either, but I suspect that would be more work (and it might be useful to have a "active_build" action anyway for other purposes)

Related