Usage example of bazel-compile-commands
See comments in WORKSPACE, BUILD.bazel and .bazelrc
bazel build '@//:example'
bazel run '@bazel_compile_commands//:gen_compile_commands.sh'You need to run bazel run '@bazel_compile_commands//:gen_compile_commands.sh' only when project changes: new dependency, changed build options, etc.