tool shoutout of the day: bear - https://github.com/rizsotto/Bear
you just put the bear command in front of the build command for any C or C++ build system that exists and it will generate a compile_commands.json for the clang language server in your editor. it's great