Skip to content

Commit 6fa42d2

Browse files
authored
docs: update api/description/builtin-rules.md (#256)
1 parent 39fa8cf commit 6fa42d2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

docs/api/description/builtin-rules.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ For more information on WDK rules, see: [#159](https://github.com/xmake-io/xmake
468468

469469
## plugin.vsxmake.autoupdate
470470

471-
We can use this rule to automatically update the VS project file (when each build is completed) in the VS project generated by `xmake project -k vsxmake`.
471+
Automatically update the VS project file (when each build is completed) in the VS project generated by `xmake project -k vsxmake`.
472472

473473
```lua
474474
add_rules("plugin.vsxmake.autoupdate")
@@ -479,10 +479,21 @@ target("test")
479479

480480
## plugin.compile_commands.autoupdate
481481

482-
We can also use this rule to automatically update the generated `compile_commands.json`
482+
Automatically update the `compile_commands.json` file, commonly used with language servers like clangd:
483+
484+
```lua
485+
add_rules("plugin.compile_commands.autoupdate")
486+
487+
target("test")
488+
set_kind("binary")
489+
add_files("src/*.c")
490+
```
491+
492+
And if needed, set a custom output directory:
483493

484494
```lua
485495
add_rules("plugin.compile_commands.autoupdate", {outputdir = ".vscode"})
496+
486497
target("test")
487498
set_kind("binary")
488499
add_files("src/*.c")

0 commit comments

Comments
 (0)