Skip to content

Commit

Permalink
Revert "Stop recommending query driver by default due to clangd bugs"
Browse files Browse the repository at this point in the history
This reverts commit 7d83741.
  • Loading branch information
cpsauer committed Nov 17, 2022
1 parent 0390730 commit 3bb6d78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ Then, open VSCode *user* settings, so things will be automatically set up for al

Search for "clangd".

Add the following (separate) entries to `"clangd.arguments"`:
Add the following three separate entries to `"clangd.arguments"`:
```Shell
--header-insertion=never
--compile-commands-dir=${workspaceFolder}/
--query-driver=**
```
(Just copy each as written; VSCode will correctly expand `${workspaceFolder}` for each workspace.)
- They get rid of (overzealous) header insertion and locate the compile commands correctly, even when browsing system headers outside the source tree.
- They get rid of (overzealous) header insertion; locate the compile commands correctly, even when browsing system headers outside the source tree; and cause `clangd` to interrogate Bazel's compiler wrappers to figure out which system headers are included by default.
- If your Bazel `WORKSPACE` is a subdirectory of your project, change `--compile-commands-dir` to point into that subdirectory by overriding *both* flags in your *workspace* settings
- If later you discover that clangd isn't finding system headers correctly, try adding `--query-driver=**` to the above list of arguments. This causes `clangd` to interrogate Bazel's compiler wrappers more deeply to figure out which system headers are included by default. However, while it fixes some issues, it also causes others; Clangd has some bugs here, unfortunately. <!-- https://github.com/clangd/clangd/issues/1378 -->

<!-- At least until https://github.com/clangd/vscode-clangd/issues/138 is resolved. -->
Turn on: Clangd: Check Updates
Expand Down

0 comments on commit 3bb6d78

Please sign in to comment.