Clarify compile_commands.json command in the clangd Quick Start.
Several engineers all independently missed a critical step while setting up clangd for VSCode, and each encountered the same issue - missing headers, as highlighted at https://clangd.llvm.org/troubleshooting.html#cant-find-includes-within-your-project. This is an easy mistake to make while copying/pasting lots of commands during the setup process. Simplified and clarified this step a bit. Change-Id: I6f7c909724f302b622b172d7e05c575910db1f80 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4573756 Reviewed-by: Caleb Raitto <caraitto@chromium.org> Commit-Queue: Orr Bernstein <orrb@google.com> Cr-Commit-Position: refs/heads/main@{#1151417}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
562722f551
commit
197b492ab7
@ -13,8 +13,14 @@ your editor.
|
||||
* Optional: build chrome normally to get generated headers
|
||||
* Generate compilation database (note: it's not regenerated automatically):
|
||||
```
|
||||
tools/clang/scripts/generate_compdb.py -p out/<build> > compile_commands.json
|
||||
tools/clang/scripts/generate_compdb.py -p out/Default > compile_commands.json
|
||||
```
|
||||
|
||||
*** note
|
||||
Note: If you're using a different build directory, you'll need to replace `out/Default`
|
||||
in this and other commands with your build directory.
|
||||
***
|
||||
|
||||
* Indexing is enabled by default (since clangd 9), note that this might consume
|
||||
lots of CPU and RAM. There's also a
|
||||
[remote-index service](https://github.com/clangd/chrome-remote-index/blob/main/docs/index.md)
|
||||
|
Reference in New Issue
Block a user