Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions docs/api/description/builtin-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ For more information on WDK rules, see: [#159](https://github.com/xmake-io/xmake

## plugin.vsxmake.autoupdate

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`.
Automatically update the VS project file (when each build is completed) in the VS project generated by `xmake project -k vsxmake`.

```lua
add_rules("plugin.vsxmake.autoupdate")
Expand All @@ -479,10 +479,21 @@ target("test")

## plugin.compile_commands.autoupdate

We can also use this rule to automatically update the generated `compile_commands.json`
Automatically update the `compile_commands.json` file, commonly used with language servers like clangd:

```lua
add_rules("plugin.compile_commands.autoupdate")

target("test")
set_kind("binary")
add_files("src/*.c")
```

And if needed, set a custom output directory:

```lua
add_rules("plugin.compile_commands.autoupdate", {outputdir = ".vscode"})

target("test")
set_kind("binary")
add_files("src/*.c")
Expand Down