Copied from this issue. Generates compile-commands.json files using catkin and bash, used with language servers like clangd.
jqbuild-essentialson Debian-based,base-develon Arch-based, or equivalent.catkin
make install [PREFIX=/installation/directory]make uninstall [PREFIX=/installation/directory]nix build .- Build your packages using the flag 
-DCMAKE_EXPORT_COMPILE_COMMANDS=YESor put the following inCMakeLists.txt: 
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)- Create 
.extended_wsin workspace root - Put catkin workspaces to be 
source'd into.extended_ws, e.g./opt/ros/noetics - In catkin root directory, run
 
catkin-compile-commandsRestart your language server if necessary.