Skip to content

Commit

Permalink
Missing period
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsauer committed Nov 17, 2022
1 parent 7d83741 commit 0390730
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ImplementationReadme.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ It's worth knowing that `clangd` doesn't actually execute the command, but rathe

This means that fancy things like specifying environment variables in the command or passing in a wrapper compiler driver that accepts the same flags but does some unnecessary expansion (Bazel...) will break things. You need to carefully unwrap Bazel's (unnecessary) compiler driver wrappers to get clangd to pick up on commands.

`clangd` also tries to introspect the compiler specified to figure out what include paths it adds implicitly. Usually it just checks the relative path, following clang (and maybe others') conventions. Iff you use the `--query-driver` flag it will directly invoke the compiler and ask it about those includes If you don't specify `--query-driver` and it can't find the includes at the relative path (like in the case of Bazel's compiler wrappers) it will miss those default includes. If you're seeing red squigglies under, e.g., standard library headers or system headers that should be included by default, you've probably run into a failure of this type. [[For more context, see this issue about making driver automatic.](https://github.com/clangd/clangd/issues/539)]
`clangd` also tries to introspect the compiler specified to figure out what include paths it adds implicitly. Usually it just checks the relative path, following clang (and maybe others') conventions. Iff you use the `--query-driver` flag it will directly invoke the compiler and ask it about those includes. If you don't specify `--query-driver` and it can't find the includes at the relative path (like in the case of Bazel's compiler wrappers) it will miss those default includes. If you're seeing red squigglies under, e.g., standard library headers or system headers that should be included by default, you've probably run into a failure of this type. [[For more context, see this issue about making driver automatic.](https://github.com/clangd/clangd/issues/539)]

All this means it's crucial to de-Bazel the command we write to `compile_commands.json` enough that `clangd` can invoke it to get default header search paths--and so `clangd` can understand its flags *without* invoking it. No compiler driver wrappers requiring Bazel-specific environment variables to run, nor flags that need custom expansion `clangd` wouldn't know about, etc. All this happens in [`refresh.template.py`](./refresh.template.py), details there.

Expand Down

0 comments on commit 0390730

Please sign in to comment.