Editors such as Emacs, Vim, or VS Code support features like code navigation,
code completion, inline compiler error messages, and others, through
LSP, the Language
Server Protocol. A common language server with LSP support is
clangd, which relies on the presence of
compile_commands.json, a JSON file with a record of the compile commands for
each file in a project.
How do I generate compile_commands.json for XLA source code?
Use the
build_tools/lint/generate_compile_commands.py
script. The following invocation from XLA repo root generates a
compile_commands.json file in place: bazel aquery "mnemonic(CppCompile,
//xla/...)" --output=jsonproto | python3
build_tools/lint/generate_compile_commands.py
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-05 UTC."],[],[]]