Skip to content

docs: expand compilation database generation guide - #401

Merged
16bit-ykiko merged 4 commits into
mainfrom
docs/xmake-cdb
Apr 6, 2026
Merged

16bit-ykiko merged 4 commits into
mainfrom
docs/xmake-cdb

Conversation

@16bit-ykiko

@16bit-ykiko 16bit-ykiko commented Apr 6, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fill in Visual Studio, Makefile, Meson sections (previously TODO)
  • Expand Xmake section with CLI and VSCode extension workflows
  • Simplify Others section to recommend catter
  • Fix CJK-Latin spacing in Chinese docs
  • English and Chinese docs updated in sync

Supersedes #313 by @Stehsaer.

🤖 Generated with Claude Code

Co-Authored-By: Stehsaer <Stehsaer@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 6, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Updated English and Chinese Quick Start guides with concrete, build-system-specific instructions to generate compile_commands.json for Visual Studio (CMake and MSBuild), Makefile, Meson, Xmake (CLI and VSCode), and an updated "Others" tool recommendation.

Changes

Cohort / File(s) Summary
Quick Start docs (English & Chinese)
docs/en/guide/quick-start.md, docs/zh/guide/quick-start.md
Replaced TODO placeholders with concrete steps to generate compile_commands.json across build systems: Visual Studio CMakeSettings.json (-DCMAKE_EXPORT_COMPILE_COMMANDS=ON) and MSBuild options (compiledb-vs, catter), Makefile (bear -- make, compiledb make, note on clean build), Meson (meson setup build auto-generation), Xmake (CLI xmake project -k compile_commands --lsp=clangd build and VSCode extension workflow with xmake.compileCommandsDirectory), and updated "Others" to recommend catter (removed prior plan/tooling text).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibble docs and tidy trails,

From CMake flags to Xmake sails,
Makefiles hum and Meson sings,
Compile commands on gentle springs,
A little hop, and build-time prevails.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'docs: expand compilation database generation guide' accurately describes the main change — replacing TODO placeholders with concrete build-system-specific instructions for generating compile_commands.json across Visual Studio, Makefile, Meson, Xmake, and other build systems.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/xmake-cdb

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
docs/en/guide/quick-start.md (1)

79-83: Clarify the settings.json snippet for copy-paste safety.

Consider showing the key inside a minimal JSON object (or explicitly noting trailing comma rules) so users don’t paste an invalid fragment; also “updates on xmake.lua” reads better as “updates to xmake.lua.”

✏️ Proposed doc tweak
-The Xmake official VSCode extension provides autonomous generation of compilation database upon updates on `xmake.lua`. However, it generates the database to `.vscode` directory. Append this setting in `settings.json`:
+The official Xmake VS Code extension can auto-generate the compilation database when `xmake.lua` is updated. By default, it writes to the `.vscode` directory. Add this in `settings.json`:
 
 ```json
-"xmake.compileCommandsDirectory": "build"
+{
+  "xmake.compileCommandsDirectory": "build"
+}
</details>

</blockquote></details>
<details>
<summary>docs/zh/guide/quick-start.md (1)</summary><blockquote>

`77-85`: **优化中文技术文档可读性(术语与路径前后空格)。**

这里建议对 `VSCode`、`.vscode`、`settings.json`、`build` 等术语前后加空格,并稍微收敛句式,阅读体验会更好。  

<details>
<summary>✏️ 建议改写</summary>

```diff
-#### VSCode扩展
+#### VS Code 扩展
 
-Xmake提供的官方VSCode扩展已经自带了编译数据库生成(保存时其会自动生成编译数据库)。然而默认情况下,它将编译数据库生成到了`.vscode`文件夹。在`settings.json`中添加以下配置:
+Xmake 官方 VS Code 扩展自带编译数据库生成能力(保存时会自动生成)。但默认会生成到 `.vscode` 目录。可在 `settings.json` 中添加:
@@
-以将编译数据库的生成目录调整到`build`,供clice使用。
+将编译数据库输出目录调整到 `build`,供 clice 使用。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/zh/guide/quick-start.md` around lines 77 - 85, Edit the paragraph about
the VSCode extension to improve Chinese readability by adding spaces around
technical terms and paths (e.g., "VSCode", ".vscode", "settings.json", "build")
and tightening the sentence structure; specifically, rewrite the two sentences
so they read smoothly and concisely (mention that Xmake 的 VSCode
扩展会在保存时自动生成编译数据库,默认放在 `.vscode`,并示例在 `settings.json` 中添加
`"xmake.compileCommandsDirectory": "build"` 来改为 `build` 目录供 clice 使用), ensuring
each term has a space before and after for clarity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/zh/guide/quick-start.md`:
- Around line 77-85: Edit the paragraph about the VSCode extension to improve
Chinese readability by adding spaces around technical terms and paths (e.g.,
"VSCode", ".vscode", "settings.json", "build") and tightening the sentence
structure; specifically, rewrite the two sentences so they read smoothly and
concisely (mention that Xmake 的 VSCode 扩展会在保存时自动生成编译数据库,默认放在 `.vscode`,并示例在
`settings.json` 中添加 `"xmake.compileCommandsDirectory": "build"` 来改为 `build` 目录供
clice 使用), ensuring each term has a space before and after for clarity.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 42609713-d53b-4d66-8d38-4ce5829da4e4

📥 Commits

Reviewing files that changed from the base of the PR and between 0c107fc and 75a095d.

📒 Files selected for processing (2)
  • docs/en/guide/quick-start.md
  • docs/zh/guide/quick-start.md

16bit-ykiko and others added 3 commits April 6, 2026 15:44
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… catter

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/zh/guide/quick-start.md`:
- Line 82: The Chinese phrasing in the sentence "注意 `bear`
需要干净的构建来捕获所有命令——如果需要的话,在运行 `bear -- make` 之前先执行 `make clean`。" is unnatural;
replace "需要干净的构建" with "需要干净地构建" so the sentence reads "注意 `bear`
需要干净地构建来捕获所有命令——如果需要的话,在运行 `bear -- make` 之前先执行 `make clean`。", updating the
existing sentence text accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 39bdc457-9921-4dbe-965f-48894259e943

📥 Commits

Reviewing files that changed from the base of the PR and between 35511ca and 13e2ffe.

📒 Files selected for processing (2)
  • docs/en/guide/quick-start.md
  • docs/zh/guide/quick-start.md
✅ Files skipped from review due to trivial changes (1)
  • docs/en/guide/quick-start.md

Comment thread docs/zh/guide/quick-start.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
docs/zh/guide/quick-start.md (1)

82-82: ⚠️ Potential issue | 🟡 Minor

中文措辞建议沿用先前修正:将“干净的构建”改为“干净地构建”。

Line 82 当前表述仍略不自然,建议改为“bear 需要干净地构建来捕获所有命令”。

✏️ 建议修改
-这会在当前目录生成 `compile_commands.json`。注意 `bear` 需要干净的构建来捕获所有命令——如果需要的话,在运行 `bear -- make` 之前先执行 `make clean`。
+这会在当前目录生成 `compile_commands.json`。注意 `bear` 需要干净地构建来捕获所有命令——如果需要的话,在运行 `bear -- make` 之前先执行 `make clean`。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/zh/guide/quick-start.md` at line 82, Update the Chinese wording in the
sentence containing `bear` and `bear -- make`: replace “干净的构建” with “干净地构建” so
the sentence reads like “`bear` 需要干净地构建来捕获所有命令——如果需要的话,在运行 `bear -- make` 之前先执行
`make clean`。”; adjust only that phrase in quick-start.md to keep wording
consistent with prior fixes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@docs/zh/guide/quick-start.md`:
- Line 82: Update the Chinese wording in the sentence containing `bear` and
`bear -- make`: replace “干净的构建” with “干净地构建” so the sentence reads like “`bear`
需要干净地构建来捕获所有命令——如果需要的话,在运行 `bear -- make` 之前先执行 `make clean`。”; adjust only that
phrase in quick-start.md to keep wording consistent with prior fixes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d226afff-3a3c-4223-a339-831e6ce29c35

📥 Commits

Reviewing files that changed from the base of the PR and between 13e2ffe and ca30177.

📒 Files selected for processing (2)
  • docs/en/guide/quick-start.md
  • docs/zh/guide/quick-start.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/en/guide/quick-start.md

@16bit-ykiko 16bit-ykiko changed the title docs: add xmake compilation database generation guide docs: expand compilation database generation guide Apr 6, 2026
@16bit-ykiko
16bit-ykiko merged commit a40c0b3 into main Apr 6, 2026
10 checks passed
@16bit-ykiko
16bit-ykiko deleted the docs/xmake-cdb branch April 6, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant