From c588c376a76cd173c8b44e6ba2a3af6d01495d89 Mon Sep 17 00:00:00 2001 From: qudix <17361645+qudix@users.noreply.github.com> Date: Wed, 19 Nov 2025 16:36:03 -0600 Subject: [PATCH] docs: update api/description/builtin-rules.md --- docs/api/description/builtin-rules.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/api/description/builtin-rules.md b/docs/api/description/builtin-rules.md index a5d3da23..68dfffc4 100644 --- a/docs/api/description/builtin-rules.md +++ b/docs/api/description/builtin-rules.md @@ -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") @@ -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")