Skip to content

Commit 320ac95

Browse files
Add BuiltinHeaders to config docs (#124)
Co-authored-by: Nathan Ridge <[email protected]>
1 parent 8e1c4c6 commit 320ac95

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

config.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,29 @@ flag parsing (clang vs clang-cl), target inference (gcc-arm-noneabi) etc.
147147
If the option matches a glob mentioned in `--query-driver`, then it'll be
148148
invoked for extraction of include paths.
149149

150+
### BuiltinHeaders
151+
{:.v21}
152+
153+
Controls whether Clangd should include its own built-in headers (like
154+
stddef.h), or use the system header found from the query driver.
155+
156+
Valid values are:
157+
- `Clangd`: Use builtin headers from `clangd`. This is the default.
158+
- `QueryDriver`: Use the headers extracted from the compiler via the
159+
`--query-driver` command line argument. If a query driver is not supplied or
160+
does not match the compiler, then the `Clangd` builtin headers will be the
161+
fallback.
162+
163+
```yaml
164+
CompileFlags:
165+
BuiltinHeaders: QueryDriver
166+
```
167+
168+
**Note**: if the driver is not clang, `BuiltinHeaders: QueryDriver` will result
169+
in the clang frontend (embedded in clangd) processing the builtin headers of
170+
another compiler, which could lead to unexpected results such as false positive
171+
diagnostics.
172+
150173
## Index
151174

152175
Controls how clangd understands code outside the current file.

styles.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ a[href^="https://code.woboq.org/"] {
170170
/* Version marker ornaments */
171171
.v6::before, .v7::before, .v8::before, .v9::before, .v10::before, .v11::before, .v12::before,
172172
.v13::before, .v14::before, .v15::before, .v16::before, .v17::before, .v18::before, .v19::before,
173-
.v20::before {
173+
.v20::before, .v21::before {
174174
color: #008;
175175
border-radius: 3px;
176176
padding: 0.2em 0.6em;
@@ -197,6 +197,7 @@ a[href^="https://code.woboq.org/"] {
197197
.v18::before { content: "clangd-18"; }
198198
.v19::before { content: "clangd-19"; }
199199
.v20::before { content: "clangd-20"; }
200+
.v21::before { content: "clangd-21"; }
200201
#edit {
201202
text-decoration: none;
202203
position: absolute;

0 commit comments

Comments
 (0)