@chengzhao-dev/dsh-cpp-workflow 0.7.3 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +7 -7
- package/README.md +7 -7
- package/lib/client.js +1 -1
- package/lib/comment-policy.js +1 -1
- package/lib/index.js +3 -3
- package/package.json +9 -3
- package/skills/building-cpp/SKILL.md +15 -15
- package/skills/building-cpp/examples/environment.md +4 -3
- package/skills/building-cpp/references/{build-script.md → 01-build-script.md} +4 -3
- package/skills/building-cpp/references/{environment.md → 02-environment.md} +3 -2
- package/skills/building-cpp/steps/01-build.md +2 -2
- package/skills/building-cpp/steps/02-tooling.md +12 -12
- package/skills/building-cpp/steps/03-check.md +5 -5
- package/skills/building-cpp/{project/vscode/02-settings.md → steps/04-vscode.md} +24 -6
- package/skills/developing-cpp/SKILL.md +13 -13
- package/skills/developing-cpp/references/comments/{comment-rules.md → 01-comment-rules.md} +52 -47
- package/skills/developing-cpp/references/comments/{comment-style.md → 02-style.md} +11 -7
- package/skills/developing-cpp/references/comments/examples/{declaration-class.md → 01-declaration-class.md} +2 -1
- package/skills/developing-cpp/references/comments/examples/{declaration-constructor.md → 02-declaration-constructor.md} +2 -1
- package/skills/developing-cpp/references/comments/examples/{declaration-enum.md → 03-declaration-enum.md} +3 -3
- package/skills/developing-cpp/references/comments/examples/{declaration-file.md → 04-declaration-file.md} +4 -3
- package/skills/developing-cpp/references/comments/examples/{declaration-function.md → 05-declaration-function.md} +10 -29
- package/skills/developing-cpp/references/comments/examples/{declaration-member.md → 06-declaration-member.md} +1 -0
- package/skills/developing-cpp/references/comments/examples/07-declaration-predicate.md +15 -0
- package/skills/developing-cpp/references/comments/examples/{declaration-struct.md → 08-declaration-struct.md} +1 -0
- package/skills/developing-cpp/references/comments/examples/09-implementation-body.md +114 -0
- package/skills/developing-cpp/references/comments/examples/10-implementation-todo.md +17 -0
- package/skills/developing-cpp/references/comments/glossary/{comment-terms.md → 01-comment-terms.md} +8 -7
- package/skills/developing-cpp/references/design/{project-design.md → 01-project-design.md} +8 -7
- package/skills/developing-cpp/references/design/examples/{behavior-sentence.md → 01-behavior-sentence.md} +1 -0
- package/skills/developing-cpp/references/design/examples/{coordinate-table.md → 02-coordinate-table.md} +1 -0
- package/skills/developing-cpp/references/design/examples/{header-place.md → 03-header-place.md} +1 -0
- package/skills/developing-cpp/references/design/examples/{library-boundary.md → 04-library-boundary.md} +3 -2
- package/skills/developing-cpp/references/design/examples/{library-split.md → 05-library-split.md} +1 -0
- package/skills/developing-cpp/references/design/examples/{move-result.md → 06-move-result.md} +4 -10
- package/skills/developing-cpp/references/design/examples/{preview-read.md → 07-preview-read.md} +1 -0
- package/skills/developing-cpp/references/design/examples/08-screen-enter-exit.md +40 -0
- package/skills/developing-cpp/references/design/session-layer.md +91 -0
- package/skills/developing-cpp/references/exceptions/{throw-rules.md → 01-exception-rules.md} +10 -18
- package/skills/developing-cpp/references/exceptions/examples/{throw-boundary.md → 01-throw-boundary.md} +1 -0
- package/skills/developing-cpp/references/exceptions/examples/{throw-build-mode.md → 02-throw-build-mode.md} +3 -2
- package/skills/developing-cpp/references/exceptions/examples/{throw-catch.md → 03-throw-catch.md} +1 -0
- package/skills/developing-cpp/references/exceptions/examples/{throw-destructor.md → 04-throw-destructor.md} +1 -0
- package/skills/developing-cpp/references/exceptions/examples/{throw-format.md → 05-throw-format.md} +1 -0
- package/skills/developing-cpp/references/exceptions/examples/{throw-message.md → 06-throw-message.md} +2 -1
- package/skills/developing-cpp/references/exceptions/examples/{throw-when.md → 07-throw-when.md} +1 -0
- package/skills/developing-cpp/references/index.md +134 -0
- package/skills/developing-cpp/references/language/glossary/{language-terms.md → 01-language-terms.md} +3 -2
- package/skills/developing-cpp/references/language/language-basics/01-objects.md +1 -0
- package/skills/developing-cpp/references/language/language-basics/02-initialization.md +15 -7
- package/skills/developing-cpp/references/language/language-basics/03-deduction.md +1 -0
- package/skills/developing-cpp/references/language/language-basics/04-const.md +1 -0
- package/skills/developing-cpp/references/language/language-basics/05-expressions.md +7 -3
- package/skills/developing-cpp/references/language/language-basics/06-functions.md +6 -3
- package/skills/developing-cpp/references/language/language-basics/07-classes.md +1 -0
- package/skills/developing-cpp/references/language/language-basics/08-raii.md +1 -0
- package/skills/developing-cpp/references/language/language-basics/09-templates.md +1 -0
- package/skills/developing-cpp/references/language/language-basics/{10-checklist.md → 10-language-checklist.md} +2 -0
- package/skills/developing-cpp/references/language/performance/01-measure.md +1 -0
- package/skills/developing-cpp/references/language/performance/02-complexity.md +1 -0
- package/skills/developing-cpp/references/language/performance/03-memory.md +1 -0
- package/skills/developing-cpp/references/language/performance/04-undefined-behavior.md +1 -0
- package/skills/developing-cpp/references/language/performance/05-pitfalls.md +1 -0
- package/skills/developing-cpp/references/language/performance/06-false-optimizations.md +1 -0
- package/skills/developing-cpp/references/language/performance/07-checklist.md +1 -0
- package/skills/developing-cpp/references/language/standard-library/01-containers.md +5 -3
- package/skills/developing-cpp/references/language/standard-library/02-access.md +1 -0
- package/skills/developing-cpp/references/language/standard-library/03-iteration.md +1 -0
- package/skills/developing-cpp/references/language/standard-library/04-algorithms.md +1 -0
- package/skills/developing-cpp/references/language/standard-library/05-string.md +1 -0
- package/skills/developing-cpp/references/language/standard-library/06-format.md +5 -2
- package/skills/developing-cpp/references/language/standard-library/07-time.md +1 -0
- package/skills/developing-cpp/references/language/standard-library/08-random.md +2 -0
- package/skills/developing-cpp/references/language/standard-library/09-files.md +1 -0
- package/skills/developing-cpp/references/language/standard-library/{10-checklist.md → 10-library-checklist.md} +2 -1
- package/skills/developing-cpp/references/language/value-types/01-width.md +1 -0
- package/skills/developing-cpp/references/language/value-types/02-signed.md +1 -0
- package/skills/developing-cpp/references/language/value-types/03-integer-roles.md +1 -0
- package/skills/developing-cpp/references/language/value-types/04-enum.md +13 -1
- package/skills/developing-cpp/references/language/value-types/05-strong-type.md +1 -0
- package/skills/developing-cpp/references/language/value-types/06-const-method.md +1 -0
- package/skills/developing-cpp/references/language/value-types/07-nodiscard.md +1 -0
- package/skills/developing-cpp/references/language/value-types/08-comparison.md +1 -0
- package/skills/developing-cpp/references/language/value-types/09-subscript.md +2 -1
- package/skills/developing-cpp/references/language/value-types/10-float-bool.md +1 -0
- package/skills/developing-cpp/references/language/value-types/11-checklist.md +2 -0
- package/skills/developing-cpp/references/layout/01-source-layout.md +3 -2
- package/skills/developing-cpp/references/layout/02-file-template.md +4 -3
- package/skills/developing-cpp/references/layout/03-declaration-order.md +15 -4
- package/skills/developing-cpp/references/naming/{identifier-names.md → 01-identifier-names.md} +31 -9
- package/skills/developing-cpp/references/naming/examples/{naming-accessor.md → 01-naming-accessor.md} +1 -0
- package/skills/developing-cpp/references/naming/examples/02-naming-basic.md +4 -0
- package/skills/developing-cpp/references/naming/examples/{naming-current-prefix.md → 03-naming-current-prefix.md} +1 -0
- package/skills/developing-cpp/references/naming/examples/{naming-local.md → 04-naming-local.md} +2 -1
- package/skills/developing-cpp/references/naming/examples/{naming-lookup.md → 05-naming-lookup.md} +1 -0
- package/skills/developing-cpp/references/naming/examples/{naming-lower-layer.md → 06-naming-lower-layer.md} +2 -2
- package/skills/developing-cpp/references/naming/examples/{naming-multiple-return.md → 07-naming-multiple-return.md} +1 -0
- package/skills/developing-cpp/references/naming/examples/{naming-player-value.md → 08-naming-player-value.md} +1 -0
- package/skills/developing-cpp/references/naming/examples/{naming-predicate.md → 09-naming-predicate.md} +1 -0
- package/skills/developing-cpp/references/naming/examples/{naming-rename.md → 10-naming-rename.md} +1 -0
- package/skills/developing-cpp/references/naming/examples/{naming-responsibility.md → 11-naming-responsibility.md} +1 -0
- package/skills/developing-cpp/references/naming/examples/{naming-role.md → 12-naming-role.md} +1 -0
- package/skills/developing-cpp/references/naming/examples/{naming-state-change.md → 13-naming-state-change.md} +4 -4
- package/skills/developing-cpp/references/naming/glossary/01-naming-terms.md +28 -0
- package/skills/developing-cpp/references/naming/glossary/{position.md → 02-position.md} +2 -1
- package/skills/developing-cpp/references/naming/glossary/03-selection.md +23 -0
- package/skills/developing-cpp/references/naming/glossary/{square.md → 04-square.md} +3 -2
- package/skills/developing-cpp/references/naming/glossary/05-scoring.md +27 -0
- package/skills/developing-cpp/references/naming/glossary/06-difficulty.md +26 -0
- package/skills/developing-cpp/references/naming/glossary/07-stream.md +21 -0
- package/skills/developing-cpp/references/style/{google-cpp-style.md → 01-google-cpp-style.md} +16 -9
- package/skills/developing-cpp/scripts/checking-comments.mjs +107 -8
- package/skills/developing-cpp/steps/01-behavior.md +5 -5
- package/skills/developing-cpp/steps/02-boundary.md +6 -6
- package/skills/developing-cpp/steps/03-declaration.md +8 -8
- package/skills/developing-cpp/steps/04-implementation.md +17 -17
- package/skills/engineering/SKILL.md +14 -14
- package/skills/engineering/references/cmake/linking/01-libraries.md +7 -4
- package/skills/engineering/references/cmake/linking/02-rpath.md +1 -0
- package/skills/engineering/references/cmake/linking/03-undefined-reference.md +2 -1
- package/skills/engineering/references/cmake/linking/04-inspect.md +1 -1
- package/skills/engineering/references/cmake/modules/{functions.md → 01-functions.md} +3 -2
- package/skills/engineering/references/cmake/standards/{cxx-standard.md → 01-cxx-standard.md} +3 -2
- package/skills/engineering/references/cmake/standards/examples/{standard.md → 01-standard.md} +2 -1
- package/skills/engineering/references/cmake/standards/{README.md → index.md} +16 -15
- package/skills/engineering/references/cmake/standards/versions.md +44 -0
- package/skills/engineering/references/cmake/targets/{rules.md → 01-target-rules.md} +37 -5
- package/skills/engineering/references/cmake/targets/examples/{rpath.md → 01-rpath.md} +1 -0
- package/skills/engineering/references/cmake/testing/{ctest.md → 01-ctest.md} +3 -2
- package/skills/engineering/references/formatting/01-encoding.md +2 -1
- package/skills/engineering/references/formatting/02-clang-format.md +4 -2
- package/skills/engineering/references/formatting/03-clang-tidy.md +3 -2
- package/skills/engineering/references/formatting/04-clangd.md +2 -0
- package/skills/engineering/references/formatting/examples/{clang-format.md → 01-clang-format.md} +2 -1
- package/skills/engineering/references/formatting/examples/{clang-tidy.md → 02-clang-tidy.md} +1 -0
- package/skills/engineering/references/formatting/examples/{clangd.md → 03-clangd.md} +1 -0
- package/skills/engineering/references/index.md +32 -0
- package/skills/engineering/steps/01-targets.md +3 -3
- package/skills/engineering/steps/02-modules.md +3 -3
- package/skills/engineering/steps/03-check.md +1 -1
- package/skills/shared/budget.md +20 -0
- package/skills/{developing-cpp/references/editing/01-edit-operations.md → shared/operations.md} +7 -3
- package/skills/{developing-cpp/references/editing/02-rule-priority.md → shared/rule-priority.md} +8 -1
- package/skills/building-cpp/project/vscode/01-extensions.md +0 -28
- package/skills/developing-cpp/references/comments/examples/declaration-predicate.md +0 -14
- package/skills/developing-cpp/references/comments/examples/implementation-body.md +0 -81
- package/skills/developing-cpp/references/comments/examples/implementation-todo.md +0 -16
- package/skills/developing-cpp/references/naming/examples/naming-basic.md +0 -3
- package/skills/developing-cpp/references/naming/glossary/naming-terms.md +0 -23
- package/skills/engineering/references/cmake/standards/c++11/README.md +0 -50
- package/skills/engineering/references/cmake/standards/c++14/README.md +0 -48
- package/skills/engineering/references/cmake/standards/c++17/README.md +0 -50
- package/skills/engineering/references/cmake/standards/c++20/README.md +0 -50
- package/skills/engineering/references/cmake/standards/c++23/README.md +0 -50
- package/skills/engineering/references/cmake/targets/examples/glob.md +0 -22
- package/skills/engineering/references/cmake/targets/examples/target.md +0 -156
- /package/skills/engineering/{references/formatting/scripts → scripts}/checking-encoding.mjs +0 -0
package/README.en.md
CHANGED
|
@@ -22,16 +22,16 @@ Fixed-version npm install:
|
|
|
22
22
|
dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.1
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
The latest published version is `0.7.1`; `0.7.
|
|
25
|
+
The latest published version is `0.7.1`; `0.7.5` exists only in the working tree and is not published yet, so use `0.7.1` above until it is released. `0.7.3` is skipped and will not be published. After the working-tree version is published, switch the npm command to:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.
|
|
28
|
+
dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.5
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
GitHub tag installs require the matching tag; once `v0.7.
|
|
31
|
+
GitHub tag installs require the matching tag; once `v0.7.5` is created, the version in the address matches the tag:
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
dsh plugin --profile <profile> add github:chengzhao-dev/dsh-cpp-workflow#v0.7.
|
|
34
|
+
dsh plugin --profile <profile> add github:chengzhao-dev/dsh-cpp-workflow#v0.7.5
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
Replace `--profile` with the profile you actually run. The desktop app always runs the `desktop` profile, and that profile is owned by the app; if the command-line `add` is rejected, add the plugin in the app settings and use the same pinned npm version. A Git tag install uses the prebuilt `lib/` committed in the repository and runs no build on the target machine; the package has no install script that needs approval.
|
|
@@ -70,7 +70,7 @@ Keep one `environment.json` per repository. Its first three environment axes are
|
|
|
70
70
|
| `compiler` | `clang`, `gcc` | One compiler per configuration |
|
|
71
71
|
| `standard` | `c++11`, `c++14`, `c++17`, `c++20`, `c++23` | New projects default to `c++23`; one standard per project |
|
|
72
72
|
|
|
73
|
-
The standard lives in `environment.json` as `standard` and must match the CMake target and compile database; on the CMake side, prefer `engineering`'s `CompileSettings_SetCxxStandard` function. New projects default to C++23; for C++11–C++20, lower `standard`, `cxx_std_*`, `CXX_STANDARD`, and the `.clang-format` parsing level together, not one at a time. Per-standard facilities, tooling, and downgrade tables are in the [standard directory](skills/engineering/references/cmake/standards/
|
|
73
|
+
The standard lives in `environment.json` as `standard` and must match the CMake target and compile database; on the CMake side, prefer `engineering`'s `CompileSettings_SetCxxStandard` function. New projects default to C++23; for C++11–C++20, lower `standard`, `cxx_std_*`, `CXX_STANDARD`, and the `.clang-format` parsing level together, not one at a time. Per-standard facilities, tooling, and downgrade tables are in the [standard directory](skills/engineering/references/cmake/standards/index.md); the CMake two-layer declaration is in [01-cxx-standard.md](skills/engineering/references/cmake/standards/01-cxx-standard.md).
|
|
74
74
|
|
|
75
75
|
The generator is always Ninja. Build directories are `build/clang/` and `build/gcc/`; they are never shared. Analysis tools are always `clang-format`, `clang-tidy`, and `clangd`; GCC mode does not switch to another analyzer.
|
|
76
76
|
|
|
@@ -89,7 +89,7 @@ The project root carries only `.vscode/extensions.json` and `settings.json`: cla
|
|
|
89
89
|
|
|
90
90
|
The runtime closure is `lib/`, `skills/`, `templates/`, `locale/`, `cordis.patch.yml`, both READMEs, `LICENSE`, and `icon.svg`. The repository also keeps `src/`, `scripts/`, `tests/`, and `docs/` for development and review; they are not published. The authoritative whitelist and per-directory map live in [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md).
|
|
91
91
|
|
|
92
|
-
Maintenance notes: flow and gate in [docs/plugin-flow.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-flow.md), skill layers and data flow in [docs/architecture.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/architecture.md), trigger matrix in [docs/triggering.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/triggering.md), directory and npm whitelist in [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md), runtime disk and cache boundaries in [docs/plugin-storage.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-storage.md), version rules in [docs/versioning.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/versioning.md).
|
|
92
|
+
Maintenance notes: flow and gate in [docs/plugin-flow.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-flow.md), skill layers and data flow in [docs/architecture.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/architecture.md), trigger matrix in [docs/triggering.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/triggering.md), directory and npm whitelist in [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md), runtime disk and cache boundaries in [docs/plugin-storage.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-storage.md), design principles in [docs/design-principles.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/design-principles.md), comment and naming source-research process in [docs/comment-sources.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/comment-sources.md), version rules in [docs/versioning.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/versioning.md).
|
|
93
93
|
|
|
94
94
|
## Local development
|
|
95
95
|
|
|
@@ -97,7 +97,7 @@ Requires Node.js 22 or newer.
|
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
99
|
npm ci
|
|
100
|
-
npm test # build, structural/encoding/workflow checks, and
|
|
100
|
+
npm test # main pre-commit gate: build, structural/encoding/workflow checks, and unit tests
|
|
101
101
|
npm run test:matrix # real build matrix: 4 templates x 5 standards
|
|
102
102
|
npm run pack:check # inspect the npm package contents
|
|
103
103
|
npm run ci # replay the Ubuntu CI job: install, test, package check
|
package/README.md
CHANGED
|
@@ -22,16 +22,16 @@ npm 安装固定版本:
|
|
|
22
22
|
dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.1
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
npm 当前最新发布是 `0.7.1`;仓库工作区里的 `0.7.
|
|
25
|
+
npm 当前最新发布是 `0.7.1`;仓库工作区里的 `0.7.5` 尚未发布,发布前请用上面的 0.7.1。`0.7.3` 已跳过、不再发布。工作区版本发布后,把 npm 命令换成:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.
|
|
28
|
+
dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.5
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
GitHub 标签安装要等 `v0.7.
|
|
31
|
+
GitHub 标签安装要等 `v0.7.5` 创建后再用;标签创建后,地址中的版本号与标签同号:
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
dsh plugin --profile <profile> add github:chengzhao-dev/dsh-cpp-workflow#v0.7.
|
|
34
|
+
dsh plugin --profile <profile> add github:chengzhao-dev/dsh-cpp-workflow#v0.7.5
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
`--profile` 换成你实际运行的那个 profile。桌面应用固定跑 `desktop` profile,且该 profile 由应用独占管理;命令行 `add` 被拒绝时,在应用设置里添加插件,地址填同一个 npm 版本。Git 标签安装使用仓库内已构建的 `lib/`,不在目标机器上重新构建;包内也不含需要授权执行的安装脚本。
|
|
@@ -70,7 +70,7 @@ dsh plugin --profile <profile> add github:chengzhao-dev/dsh-cpp-workflow#v0.7.3
|
|
|
70
70
|
| `compiler` | `clang`、`gcc` | 一次配置一个编译器 |
|
|
71
71
|
| `standard` | `c++11`、`c++14`、`c++17`、`c++20`、`c++23` | 新工程默认 `c++23`;一个工程一个标准 |
|
|
72
72
|
|
|
73
|
-
标准写在 `environment.json` 的 `standard`,并同步到 CMake target 和编译数据库;CMake 侧优先调用 `engineering` 提供的 `CompileSettings_SetCxxStandard` 函数。新工程默认 C++23;C++11–C++20 工程把 `standard`、`cxx_std_*`、`CXX_STANDARD` 和 `.clang-format` 的解析档位一起降级,不要只改一处。每档的设施、工具和降档表见 [标准目录](skills/engineering/references/cmake/standards/
|
|
73
|
+
标准写在 `environment.json` 的 `standard`,并同步到 CMake target 和编译数据库;CMake 侧优先调用 `engineering` 提供的 `CompileSettings_SetCxxStandard` 函数。新工程默认 C++23;C++11–C++20 工程把 `standard`、`cxx_std_*`、`CXX_STANDARD` 和 `.clang-format` 的解析档位一起降级,不要只改一处。每档的设施、工具和降档表见 [标准目录](skills/engineering/references/cmake/standards/index.md),CMake 两层声明见 [01-cxx-standard.md](skills/engineering/references/cmake/standards/01-cxx-standard.md)。
|
|
74
74
|
|
|
75
75
|
生成器固定 Ninja,构建目录是 `build/clang/` 与 `build/gcc/`,不共用 `build/`。诊断工具固定 `clang-format`、`clang-tidy`、`clangd`;GCC 模式也不换成别的分析器。
|
|
76
76
|
|
|
@@ -89,7 +89,7 @@ node "<skill-dir>/scripts/checking-environment.mjs" --project . --live
|
|
|
89
89
|
|
|
90
90
|
运行时闭包是 `lib/`、`skills/`、`templates/`、`locale/`、`cordis.patch.yml`、两个 README、`LICENSE` 与 `icon.svg`。仓库另有 `src/`、`scripts/`、`tests/` 与 `docs/`,只服务开发与评审,不进包。权威白名单与逐项目录见 [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md)。
|
|
91
91
|
|
|
92
|
-
边界与门禁的维护说明在 [docs/plugin-flow.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-flow.md),技能的层次与数据流在 [docs/architecture.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/architecture.md),触发矩阵在 [docs/triggering.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/triggering.md),目录和进包白名单在 [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md),运行时磁盘与缓存边界在 [docs/plugin-storage.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-storage.md),版本规则在 [docs/versioning.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/versioning.md)。
|
|
92
|
+
边界与门禁的维护说明在 [docs/plugin-flow.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-flow.md),技能的层次与数据流在 [docs/architecture.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/architecture.md),触发矩阵在 [docs/triggering.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/triggering.md),目录和进包白名单在 [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md),运行时磁盘与缓存边界在 [docs/plugin-storage.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-storage.md),设计原则在 [docs/design-principles.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/design-principles.md),注释与命名资料检索流程在 [docs/comment-sources.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/comment-sources.md),版本规则在 [docs/versioning.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/versioning.md)。
|
|
93
93
|
|
|
94
94
|
## 本地开发
|
|
95
95
|
|
|
@@ -97,7 +97,7 @@ node "<skill-dir>/scripts/checking-environment.mjs" --project . --live
|
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
99
|
npm ci
|
|
100
|
-
npm test #
|
|
100
|
+
npm test # 提交前主门:构建、结构/编码/工作流检查与单元测试
|
|
101
101
|
npm run test:matrix # 四套模板 × 五档标准的真实构建矩阵
|
|
102
102
|
npm run pack:check # 核对 npm 包内容
|
|
103
103
|
npm run ci # 复现 Ubuntu CI:安装、测试、打包检查(不含标准矩阵)
|
package/lib/client.js
CHANGED
|
@@ -9,7 +9,7 @@ window.__ModuleLoader__.load({
|
|
|
9
9
|
* 注释标签策略:设置页的预览、技能快照与检查器参数共用这一份。
|
|
10
10
|
*
|
|
11
11
|
* 配置只描述「写注释时默认带哪些标签、声明用哪种注释符号」,不描述写法本身;
|
|
12
|
-
* 写法在 `skills/developing-cpp/references/comments/
|
|
12
|
+
* 写法在 `skills/developing-cpp/references/comments/01-rules.md`。设置页保存的值由宿主
|
|
13
13
|
* 写回插件 Config,服务端 `apply(ctx, config)` 用它生成本页快照与检查器参数。
|
|
14
14
|
*
|
|
15
15
|
* 这份文件被 `tsc` 编进 `lib/comment-policy.js`,打包客户端半侧时再内联进
|
package/lib/comment-policy.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 注释标签策略:设置页的预览、技能快照与检查器参数共用这一份。
|
|
3
3
|
*
|
|
4
4
|
* 配置只描述「写注释时默认带哪些标签、声明用哪种注释符号」,不描述写法本身;
|
|
5
|
-
* 写法在 `skills/developing-cpp/references/comments/
|
|
5
|
+
* 写法在 `skills/developing-cpp/references/comments/01-rules.md`。设置页保存的值由宿主
|
|
6
6
|
* 写回插件 Config,服务端 `apply(ctx, config)` 用它生成本页快照与检查器参数。
|
|
7
7
|
*
|
|
8
8
|
* 这份文件被 `tsc` 编进 `lib/comment-policy.js`,打包客户端半侧时再内联进
|
package/lib/index.js
CHANGED
|
@@ -162,11 +162,11 @@ async function readCandidate(skillDir) {
|
|
|
162
162
|
}
|
|
163
163
|
async function listSkills(options = {}) {
|
|
164
164
|
if (options.signal?.aborted)
|
|
165
|
-
return [];
|
|
165
|
+
return { candidates: [], complete: false };
|
|
166
166
|
if (!(await isCppWorkflowWorkspace(options.cwd)))
|
|
167
167
|
return [];
|
|
168
168
|
if (options.signal?.aborted)
|
|
169
|
-
return [];
|
|
169
|
+
return { candidates: [], complete: false };
|
|
170
170
|
let entries;
|
|
171
171
|
try {
|
|
172
172
|
entries = await readdir(SKILLS_ROOT, { withFileTypes: true });
|
|
@@ -181,7 +181,7 @@ async function listSkills(options = {}) {
|
|
|
181
181
|
if (!entry.isDirectory() || !KNOWN_SKILLS.has(entry.name))
|
|
182
182
|
continue;
|
|
183
183
|
if (options.signal?.aborted)
|
|
184
|
-
return
|
|
184
|
+
return { candidates, complete: false };
|
|
185
185
|
const result = await readCandidate(path.join(SKILLS_ROOT, entry.name));
|
|
186
186
|
if (result.candidate)
|
|
187
187
|
candidates.push(result.candidate);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chengzhao-dev/dsh-cpp-workflow",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "写 C++ 源码、配 CMake、用 Clang 构建;头文件用 /// Doxygen 文档注释,函数体用 // 分段说明,文件头标签可在设置里改。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -37,6 +37,12 @@
|
|
|
37
37
|
"@deepseek-ai/dsh-client-ui-plugin-manager"
|
|
38
38
|
]
|
|
39
39
|
},
|
|
40
|
+
"compatibility": {
|
|
41
|
+
"dshReleases": {
|
|
42
|
+
"0.2.1-rc.1": "compatible",
|
|
43
|
+
"0.2.1-rc.5": "compatible"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
40
46
|
"catalog": {
|
|
41
47
|
"category": "skill",
|
|
42
48
|
"summary": {
|
|
@@ -51,10 +57,10 @@
|
|
|
51
57
|
"icon": "./icon.svg",
|
|
52
58
|
"scripts": {
|
|
53
59
|
"build": "tsc -p tsconfig.json && node scripts/building-client.mjs",
|
|
54
|
-
"test": "node scripts/building-client.mjs --check && npm run build && node scripts/checking-skill-links.mjs && node skills/engineering/
|
|
60
|
+
"test": "node scripts/building-client.mjs --check && npm run build && node scripts/checking-skill-links.mjs && node skills/engineering/scripts/checking-encoding.mjs --quiet && node scripts/checking-github-workflows.mjs && node --test tests/*.test.mjs",
|
|
55
61
|
"ci": "npm ci && npm test && npm run pack:check",
|
|
56
62
|
"ci:full": "npm run ci && npm run test:matrix",
|
|
57
|
-
"check:encoding": "node skills/engineering/
|
|
63
|
+
"check:encoding": "node skills/engineering/scripts/checking-encoding.mjs",
|
|
58
64
|
"check:workflows": "node scripts/checking-github-workflows.mjs",
|
|
59
65
|
"test:matrix": "bash scripts/checking-standard-matrix.sh",
|
|
60
66
|
"pack:check": "npm pack --dry-run"
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
name: building-cpp
|
|
3
3
|
description: 在已写好 CMake 的 C++11–C++23 工程上配置、构建和检查时使用:Ninja、compile_commands.json、CTest 失败、clang-format、clang-tidy、clangd、environment.json、running-build.sh 与工程内已有的 `.vscode/` 接线。不用于只改源码语义、文档、Python 或与 C++ 无关的文件。
|
|
4
4
|
metadata:
|
|
5
|
-
short-description: C++11–C++23
|
|
5
|
+
short-description: C++11–C++23 构建流程
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# building-cpp
|
|
9
9
|
|
|
10
|
-
本技能处理环境声明、构建入口与工具配置:`environment.json`、`running-build.sh`、`.clang-format`、`.clang-tidy`、`.clangd`、`.vscode/`、构建命令、编译数据库、CTest
|
|
10
|
+
本技能处理环境声明、构建入口与工具配置:`environment.json`、`running-build.sh`、`.clang-format`、`.clang-tidy`、`.clangd`、`.vscode/`、构建命令、编译数据库、CTest 与运行。加载顺序与层表见 [budget.md](../shared/budget.md)。
|
|
11
11
|
|
|
12
12
|
## 适用场景
|
|
13
13
|
|
|
@@ -17,11 +17,11 @@ metadata:
|
|
|
17
17
|
- **前置**:存在项目技能 `cpp-workflow-project` 时先读它的 `SKILL.md`、`environment.json` 和 `stages/stage-table.md`。三个环境轴为空、`standard` 非法或组合非法时停在定构建,不猜 WSL、Clang 或构建目录;`standard` 缺失或为空时按默认 `c++23` 继续并提示声明升级;`windows` + `native` 直接拒绝,提示「本版本不能在 Windows 原生壳里构建」,不给补 PowerShell 的路线。
|
|
18
18
|
- **分因**:编译失败时先看诊断指向哪一层。函数体问题回 `developing-cpp` 的定实现;找不到头、链接失败、target 不存在或标准不对转 `engineering` 的对应步骤;没有编译数据库、format/tidy 不在 PATH 或配置不生效留在本技能的定工具配置。
|
|
19
19
|
- **编码**:源码与构建文件用 UTF-8 无 BOM、检出 LF,`.bat` / `.cmd` 用 CRLF,`.clang-format` 写 `LineEnding: LF`;MSVC 原生构建优先加 `/utf-8`,不靠 BOM 过关。完整规则见 `../engineering/references/formatting/01-encoding.md`,机器规则以仓库根 `.gitattributes` 与 `.editorconfig` 为准。
|
|
20
|
-
- **编辑器**:工程根已有 `.vscode/` 时按 `
|
|
20
|
+
- **编辑器**:工程根已有 `.vscode/` 时按 `steps/04-vscode.md` 接线;从当前目录向上到 git 根都没有 `.vscode/` 时不打开、也不新建。配置、构建、运行和调试都从 CMake Tools 进入,构建仍以 `running-build.sh` 为准。
|
|
21
21
|
|
|
22
22
|
## 三种操作
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
一次只选一种操作,范围(单点、整段)是任务属性;判据、边界与交接见共用入口 [operations.md](../shared/operations.md)。本技能从 [01-build.md](steps/01-build.md) 进;四类改动是域,不是操作。
|
|
25
25
|
|
|
26
26
|
| 操作 | 什么时候用 | 从哪步进 |
|
|
27
27
|
| --- | --- | --- |
|
|
@@ -40,32 +40,32 @@ metadata:
|
|
|
40
40
|
| 1 | 定构建 | `steps/01-build.md` | 读环境声明,固定 Ninja 与单一编译器,产出编译数据库 |
|
|
41
41
|
| 2 | 定工具配置 | `steps/02-tooling.md` | 格式化、静态检查、clangd 各管一段,互不越界 |
|
|
42
42
|
| 3 | 通过检查 | `steps/03-check.md` | 按编码 → 声明校验 → 活动校验 → 项目入口的次序跑,前一步失败就停 |
|
|
43
|
+
| 4 | VS Code 接线 | `steps/04-vscode.md` | 工程已有 `.vscode/` 时在第 2 步内接扩展与设置,没有时不新建 |
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
每步只打开同号的一个步骤文件;第 2 步在工程已有 `.vscode/` 时额外读 `04-vscode.md`。判不准才打开 `examples/` 里与该步对应的案例;`references/` 保存完整条文,只在排错、整目录重构,或步骤里明确指向某一条时打开。
|
|
45
46
|
|
|
46
47
|
## 入口表
|
|
47
48
|
|
|
48
49
|
| 要做的事 | 打开 |
|
|
49
50
|
| --- | --- |
|
|
50
|
-
| 读环境轴、配置与构建 | `steps/01-build.md`;条文 `references/environment.md`;案例 `examples/environment.md` |
|
|
51
|
+
| 读环境轴、配置与构建 | `steps/01-build.md`;条文 `references/02-environment.md`;案例 `examples/environment.md` |
|
|
51
52
|
| 配 `.clang-format`、`.clang-tidy`、`.clangd` | `steps/02-tooling.md`;条文在 `../engineering/references/formatting/`,一次一份 |
|
|
52
|
-
| 工程已有 `.vscode/`,接扩展与设置 | `
|
|
53
|
-
| 编码、声明校验、活动校验与入口命令 | `steps/03-check.md`;条文 `references/build-script.md` |
|
|
53
|
+
| 工程已有 `.vscode/`,接扩展与设置 | `steps/04-vscode.md`;没有 `.vscode/` 不打开也不新建 |
|
|
54
|
+
| 编码、声明校验、活动校验与入口命令 | `steps/03-check.md`;条文 `references/01-build-script.md` |
|
|
54
55
|
| 新工程模板与可复制配置 | `assets/templates/projects/`、`assets/config/` |
|
|
56
|
+
| 操作判不准、规则冲突 | `../shared/operations.md`、`../shared/rule-priority.md` |
|
|
55
57
|
|
|
56
|
-
链接、rpath 与产物布局读 `../engineering/references/cmake/linking/01-libraries.md`;测试设计、断言与 CTest 注册读 `../engineering/references/cmake/testing/ctest.md`;CMake 的 target、标准与函数写法读 `../engineering/references/cmake/`,可复用片段在 `../engineering/references/cmake/assets/`。
|
|
58
|
+
链接、rpath 与产物布局读 `../engineering/references/cmake/linking/01-libraries.md`;测试设计、断言与 CTest 注册读 `../engineering/references/cmake/testing/01-ctest.md`;CMake 的 target、标准与函数写法读 `../engineering/references/cmake/`,可复用片段在 `../engineering/references/cmake/assets/`。
|
|
57
59
|
|
|
58
60
|
## 加载预算
|
|
59
61
|
|
|
60
|
-
-
|
|
61
|
-
- 条文只开该步点名的一份;同号案例留到下一次激活。
|
|
62
|
-
- 标准档只打开项目技能声明的那一档,没有声明时用本技能已有的新工程默认,不把其余标准档读进来。
|
|
62
|
+
加载预算见 [budget.md](../shared/budget.md);building-cpp 的步骤固定 4 份。
|
|
63
63
|
|
|
64
|
-
项目技能列出了检查命令时只跑那一条,没有时跑本技能自己的 `scripts/checking-environment.mjs` 与 `../engineering/
|
|
64
|
+
项目技能列出了检查命令时只跑那一条,没有时跑本技能自己的 `scripts/checking-environment.mjs` 与 `../engineering/scripts/checking-encoding.mjs`;退出码为 0 后停在这一步,不再继续走没有失败的步骤。入口脚本只做配置、构建、CTest 与最小运行;`clang-format` 与 `clang-tidy` 的手动检查留在定工具配置,不塞进入口脚本。`environment.json` 的三个环境轴与 `standard` 是唯一来源,缺项就停。
|
|
65
65
|
|
|
66
66
|
## 四类改动
|
|
67
67
|
|
|
68
|
-
四类改动是操作内部的域:操作定入口,域定层次。四域的定义、边界与次序见
|
|
68
|
+
四类改动是操作内部的域:操作定入口,域定层次。四域的定义、边界与次序见 [operations.md](../shared/operations.md);building-cpp 的一次改动混了两类时,按「内容 → 结构 → 版式 → 措辞」拆开做,前一类落定并经检查再进下一类。
|
|
69
69
|
|
|
70
70
|
| 类型 | 典型请求 | 入口步骤 |
|
|
71
71
|
| --- | --- | --- |
|
|
@@ -82,4 +82,4 @@ metadata:
|
|
|
82
82
|
- [ ] `clang-format --dry-run --Werror` 与 `clang-tidy` 在项目源码上零告警;只扫描项目源码和项目头。
|
|
83
83
|
- [ ] CTest 全绿,程序从该编译器的构建目录启动;有测试时注册用 `gtest_discover_tests` 或项目既有机制,运行带 `--output-on-failure --no-tests=error`,失败时报告的是具体角色和原因。
|
|
84
84
|
- [ ] 没有改源码语义,没有覆盖已有工程文件,也没有安装或下载任何工具。
|
|
85
|
-
- [ ] 工程有 `.vscode/` 时,扩展与设置按 `
|
|
85
|
+
- [ ] 工程有 `.vscode/` 时,扩展与设置按 `steps/04-vscode.md` 接好;没有时不新建,也没有 `tasks.json` 或 `launch.json` 另起构建。
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
{
|
|
7
7
|
"host": "windows",
|
|
8
8
|
"build_host": "wsl",
|
|
9
|
-
"compiler": "clang"
|
|
9
|
+
"compiler": "clang",
|
|
10
|
+
"standard": "c++23"
|
|
10
11
|
}
|
|
11
12
|
```
|
|
12
13
|
|
|
@@ -117,10 +118,10 @@ clang 模式要求四者同主版本;这里 18 与 16 不一致,`--live` 失
|
|
|
117
118
|
|
|
118
119
|
```bash
|
|
119
120
|
# CI / Windows 开发机:只读声明,不需要工具链
|
|
120
|
-
node scripts/checking-environment.mjs --project .
|
|
121
|
+
node "<skill-dir>/scripts/checking-environment.mjs" --project .
|
|
121
122
|
|
|
122
123
|
# build host 上:核对构建宿主、PATH 和版本
|
|
123
|
-
node scripts/checking-environment.mjs --project . --live
|
|
124
|
+
node "<skill-dir>/scripts/checking-environment.mjs" --project . --live
|
|
124
125
|
```
|
|
125
126
|
|
|
126
127
|
不带 `--live` 时永远不探测 PATH;不要把活动校验塞进每次构建,构建脚本已经隐含了工具存在性。
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- 读取时机:写构建脚本时;读完能回答:构建脚本;预算:一次只开这一份(88 行),不自动串联。 -->
|
|
1
2
|
# 构建脚本
|
|
2
3
|
|
|
3
4
|
`assets/templates/projects/common/running-build.sh` 是 POSIX build-host 脚本,适用于 Linux、macOS 和 Windows + WSL。`host=windows` + `build_host=native` 不是本版本支持的组合:声明校验会直接拒绝,脚本也不会在原生 Windows 壳里运行。脚本只做配置、构建、CTest 与运行;格式化与静态检查在编辑时手动跑,不混进构建入口。
|
|
@@ -6,13 +7,13 @@
|
|
|
6
7
|
|
|
7
8
|
不在 `running-build.sh` 里跑。构建脚本只做配置、构建、CTest 与运行;格式化是编辑时动作,不能让构建顺手改动源码。检查放在编辑器保存时或 CI 的独立步骤里。
|
|
8
9
|
|
|
9
|
-
检查(按工程实际源码根替换 `src/`、`include/`、`
|
|
10
|
+
检查(按工程实际源码根替换 `src/`、`include/`、`app/`、`tests/`):
|
|
10
11
|
|
|
11
12
|
```bash
|
|
12
13
|
clang-format --dry-run --Werror src/*.cpp include/*.h
|
|
13
14
|
```
|
|
14
15
|
|
|
15
|
-
需要修复时单独运行 `clang-format -i`,再回看 diff。`clang-format` 只排版,不会把行尾注释搬到上一行;数据成员注释位置按
|
|
16
|
+
需要修复时单独运行 `clang-format -i`,再回看 diff。`clang-format` 只排版,不会把行尾注释搬到上一行;数据成员注释位置按 `../../developing-cpp/references/comments/01-comment-rules.md` 的规则和 `checking-comments.mjs` 检查。
|
|
16
17
|
|
|
17
18
|
## 用法
|
|
18
19
|
|
|
@@ -58,7 +59,7 @@ clang-format --dry-run --Werror src/*.cpp include/*.h
|
|
|
58
59
|
- `Check`:两种模式都在条件不成立时打印诊断并终止。
|
|
59
60
|
- `DebugCheck`:只在 Debug 生效,`NDEBUG` 后展开为空,参数不能带副作用。
|
|
60
61
|
|
|
61
|
-
不要写成 Debug 抛异常、Release 返回 false 的模式分支;这会把调用方逼成两套逻辑。规则详见
|
|
62
|
+
不要写成 Debug 抛异常、Release 返回 false 的模式分支;这会把调用方逼成两套逻辑。规则详见 `../../developing-cpp/references/exceptions/01-exception-rules.md`。
|
|
62
63
|
|
|
63
64
|
## 失败分诊
|
|
64
65
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- 读取时机:配环境或检查工具时;读完能回答:环境组合;预算:一次只开这一份(115 行),不自动串联。 -->
|
|
1
2
|
# 环境组合
|
|
2
3
|
|
|
3
4
|
环境是**声明**,不是探测结果。项目技能 `cpp-workflow-project` 的 `environment.json` 写清楚三个环境轴和一个语言标准;构建规则、工具配置和检查都按这个声明执行。声明为空或组合非法时,先修声明,不要靠猜。
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
|
|
58
59
|
## 版本与能力
|
|
59
60
|
|
|
60
|
-
- **标准**:新工程默认 C++23,可声明 `c++11`–`c++23`;编译器必须支持对应的 `-std=c++NN`。CMake ≥ 3.20;C++11/14 的 `cxx_std_*` 需要 CMake ≥ 3.
|
|
61
|
+
- **标准**:新工程默认 C++23,可声明 `c++11`–`c++23`;编译器必须支持对应的 `-std=c++NN`。CMake ≥ 3.20;C++11/14 的 `cxx_std_*` 需要 CMake ≥ 3.1,但本工作流统一按 3.20 起步。`CXX_STANDARD_REQUIRED ON` 防止标准 decay;C++23 的库设施(如 `std::print`)以实际编译器/标准库为准。
|
|
61
62
|
- **clang-format / clang-tidy**:≥ 16。这是本工作流的工具基线;低于该版本时检查器报告具体角色和版本。
|
|
62
63
|
- **clang 模式同版本**:`clang++`、`clang-format`、`clang-tidy`、`clangd` 必须是同一 LLVM 主版本。混装 17 的 clangd 与 18 的 clang-format 会出现诊断与格式化不一致。Apple Clang 也按这条核对;若工具版本对不上,报告的是具体角色和版本,不要为了通过而改声明。
|
|
63
64
|
- **gcc 模式**:检查器不拿 GCC 的主版本去比 Clang 工具;`clang-format` / `clang-tidy` 仍要 ≥ 16,`clangd` 只要求可用。`g++` 必须是真的 GCC,不能是 Apple clang 的别名。GCC 需要自带 C++23 `<print>` / `std::expected` 的标准库;版本过旧时先升级工具链,或把项目标准降到实际可用的档位,不要改检查器绕过。
|
|
@@ -105,7 +106,7 @@ node "<skill-dir>/scripts/checking-environment.mjs" --project . --live
|
|
|
105
106
|
| 3 | 活动校验失败:不在声明的 build host、角色缺失、版本不符 |
|
|
106
107
|
| 1 | 脚本自身错误:参数错误或内部异常 |
|
|
107
108
|
|
|
108
|
-
各标准对应的编译器、库设施和工具档位见 [../../engineering/references/cmake/standards/
|
|
109
|
+
各标准对应的编译器、库设施和工具档位见 [../../engineering/references/cmake/standards/index.md](../../engineering/references/cmake/standards/index.md)。
|
|
109
110
|
|
|
110
111
|
## 依据
|
|
111
112
|
|
|
@@ -15,7 +15,7 @@ build/
|
|
|
15
15
|
|
|
16
16
|
## 前置
|
|
17
17
|
|
|
18
|
-
先读项目技能与 `environment.json`,再确认 `engineering` 已经把 target 图、公共 include、语言标准和输出目录写进 CMake。target 缺失、标准不对、include 或链接边界没写时,停止本步,转 `engineering` 的定 target 与标准;不要在这里用全局变量或临时 `-std` 绕过。 只在需要核对时打开 `../../engineering/references/cmake/targets/rules.md` 或 `../../engineering/references/cmake/standards/cxx-standard.md` 被点名的一份;CMake 的写改仍由 `engineering` 落笔。
|
|
18
|
+
先读项目技能与 `environment.json`,再确认 `engineering` 已经把 target 图、公共 include、语言标准和输出目录写进 CMake。target 缺失、标准不对、include 或链接边界没写时,停止本步,转 `engineering` 的定 target 与标准;不要在这里用全局变量或临时 `-std` 绕过。 只在需要核对时打开 `../../engineering/references/cmake/targets/01-target-rules.md` 或 `../../engineering/references/cmake/standards/01-cxx-standard.md` 被点名的一份;CMake 的写改仍由 `engineering` 落笔。
|
|
19
19
|
|
|
20
20
|
## 环境
|
|
21
21
|
|
|
@@ -59,7 +59,7 @@ GCC 模式把目录和编译器换成 `build/gcc`、`g++`(C 驱动换成 `gcc`
|
|
|
59
59
|
|
|
60
60
|
**已有工程**:先读现有 `CMakeLists.txt`,只核对 target、标准与输出目录;不改与当前任务无关的 target,大改前先让现有构建跑通。
|
|
61
61
|
|
|
62
|
-
**测试**:`enable_testing()` 与 `add_subdirectory(tests)` 的顺序由 `engineering`
|
|
62
|
+
**测试**:`enable_testing()` 与 `add_subdirectory(tests)` 的顺序由 `engineering` 定;本步不跑 CTest,CTest 在通过检查里跑;不在没有测试时加空测试。
|
|
63
63
|
|
|
64
64
|
**CMakePresets**:如果项目使用 preset,名称固定 `clang` / `gcc`,与构建目录一致;没有 preset 时直接用上面的命令。
|
|
65
65
|
|
|
@@ -9,30 +9,30 @@
|
|
|
9
9
|
- 工程拥有配置:`.clang-format`、`.clang-tidy`、`.clangd`、`.vscode/` 放在工程根;不要依赖用户主目录或插件目录里的同名文件。
|
|
10
10
|
- 只复制缺失的文件。已有配置先读再改,不覆盖;需要合并时逐项说明理由。
|
|
11
11
|
- 工具角色固定:`clang-format` 管排版,`clang-tidy` 管静态诊断,`clangd` 管补全/跳转/诊断;无论 `compiler` 是 clang 还是 gcc,这三件都用 Clang 工具链。
|
|
12
|
-
- 版本要求见 `../references/environment.md`:Clang 模式要求 `clang++`、`clang-format`、`clang-tidy`、`clangd` 同一 LLVM 主版本;GCC 模式要求 `clang-format` / `clang-tidy` ≥ 16,`clangd` 只要求可用。
|
|
12
|
+
- 版本要求见 `../references/02-environment.md`:Clang 模式要求 `clang++`、`clang-format`、`clang-tidy`、`clangd` 同一 LLVM 主版本;GCC 模式要求 `clang-format` / `clang-tidy` ≥ 16,`clangd` 只要求可用。
|
|
13
13
|
- `.clangd` 的 `CompilationDatabase` 指向 `build/<compiler>`;切换编译器时同步改,不能留旧目录。**不要写 `-std`**:它会覆盖 `compile_commands.json`,把 C++23 工程降成旧标准;标准只由构建声明和编译数据库决定。
|
|
14
14
|
- `--query-driver` 是 clangd 的命令行参数,写在 `.vscode/settings.json` 的 `clangd.arguments` 里,不是 `.clangd` 的 YAML 键。它告诉 clangd 允许执行哪个编译器驱动来取系统头路径;路径写绝对路径,并与 `environment.json` 的编译器一致。
|
|
15
15
|
- 首次复制时按轴替换三处:`compiler=clang` 用 `CompilationDatabase: build/clang`、`--query-driver=/usr/bin/clang++` 和 `cmake.debugConfig` 的 `MIMode: lldb` / `miDebuggerPath: /usr/bin/lldb`;`compiler=gcc` 用 `build/gcc`、`/usr/bin/g++` 和 `MIMode: gdb` / `/usr/bin/gdb`。只复制模板而不改这三处,GCC 模式会指向错误的数据库、驱动或调试器。原工程已有的 `.clangd` 不覆盖;要改先征得同意。
|
|
16
|
-
- `.clang-format` 保留 `Language: Cpp`、`BasedOnStyle: Google`、`Standard` 和 `LineEnding: LF`:模板资产写 `Latest`;工程按 `environment.json` 声明 C++11–C++20 时,把 `Standard` 改成 `c++NN`(映射见 `../../engineering/references/cmake/standards/
|
|
16
|
+
- `.clang-format` 保留 `Language: Cpp`、`BasedOnStyle: Google`、`Standard` 和 `LineEnding: LF`:模板资产写 `Latest`;工程按 `environment.json` 声明 C++11–C++20 时,把 `Standard` 改成 `c++NN`(映射见 `../../engineering/references/cmake/standards/index.md`)。clang-format 21/22 的 `Standard` 不接受 `c++23`,23 起才接受;为兼容旧工具,C++23 工程仍写 `Latest`。列宽、缩进与包含顺序以工程根 `.clang-format` 为准;工程显式写 `ColumnLimit` 时按工程值执行,模板资产不写 `ColumnLimit`。需要新规则时先改 `../../developing-cpp/references/style/01-google-cpp-style.md` 并说明理由。
|
|
17
17
|
- `.clang-tidy` 用 `Checks: '-*, google-*, portability-avoid-pragma-once, readability-identifier-naming'`,保留 `WarningsAsErrors: '*'` 和 `FormatStyle: file`。`google-*` 覆盖 Google 风格能静态检查的部分;`readability-identifier-naming` 只配项目确实统一的命名项:类型/枚举/别名/模板参数 PascalCase,变量/参数/成员 snake_case,类成员尾随 `_`,结构体成员不尾随,常量 `k` + PascalCase。不要设 `FunctionCase`,Google 允许 `count()` / `set_count()` 这类访问器;`portability-avoid-pragma-once` 要打开,因为工程统一用路径式守卫;不要重新打开 `cppcoreguidelines-*` 整包。
|
|
18
18
|
- `.clang-tidy` 关闭项和例外必须写理由;不要借 `-*` 之后再打开 `cppcoreguidelines-*` 这类非 Google 整族检查。
|
|
19
19
|
- `.vscode/extensions.json` 推荐 clangd、CMake Tools 与 C/C++ 扩展;`.vscode/settings.json` 固定 clangd 参数、CMake 构建目录和 `cmake.debugConfig`。配置、构建、运行和调试只从 CMake Tools 进入,不写 `tasks.json` 或 `launch.json`;C/C++ 扩展只作为 CMake 快速调试的后端,IntelliSense 关闭,避免和 clangd 并行。配置注释用 JSONC 的 `//`,贴在被解释的键上方。
|
|
20
20
|
- 配置注释写「为什么这样设」,不写「这一项是什么」;不写策略头、不指向文档路径。
|
|
21
|
-
- 格式化与静态检查只扫描项目源码:`src/`、`include/`、`
|
|
21
|
+
- 格式化与静态检查只扫描项目源码:`src/`、`include/`、`app/`、`tests/` 等实际存在的源码根;不扫描 `build/`、第三方目录、生成文件。
|
|
22
22
|
- `clang-tidy` 用 `-p build/<compiler>` 读取编译数据库,`--header-filter` 只列项目根下的顶层目录,避免把第三方头纳入;不要加 `--system-headers`,也不要用 clang-tidy 19 才加入、16 没有的 `--exclude-header-filter`。
|
|
23
|
-
- 格式化用 `--dry-run --Werror` 做检查;需要自动修复时单独运行 `-i`,不要让构建脚本悄悄改源码。`clang-format` 只排版,不会把行尾注释搬到上一行;数据成员注释位置按 `../../developing-cpp/references/comments/comment-rules.md` 检查。
|
|
23
|
+
- 格式化用 `--dry-run --Werror` 做检查;需要自动修复时单独运行 `-i`,不要让构建脚本悄悄改源码。`clang-format` 只排版,不会把行尾注释搬到上一行;数据成员注释位置按 `../../developing-cpp/references/comments/01-comment-rules.md` 检查。
|
|
24
24
|
- 工程模板里不预置 `compile_commands.json`;它由定构建的 configure 生成,是构建产物。
|
|
25
25
|
|
|
26
26
|
## 编辑器接线
|
|
27
27
|
|
|
28
|
-
- 只在工程根(当前目录到 git 根)已经有 `.vscode/` 时读
|
|
28
|
+
- 只在工程根(当前目录到 git 根)已经有 `.vscode/` 时读 `04-vscode.md`;没有 `.vscode/` 时不打开,也不新建目录。
|
|
29
29
|
- 顺序:先定 `.clang-format`、`.clang-tidy`、`.clangd`,再对照现有 `.vscode/extensions.json` 与 `settings.json` 只补缺、只改与 `environment.json` 冲突的项。
|
|
30
|
-
- 一次只读
|
|
30
|
+
- 一次只读 `04-vscode.md`;扩展与设置不要同时展开。工具条文一次只开 `../../engineering/references/formatting/` 里被点名的一份,其余留到下一次激活。
|
|
31
31
|
- 不写 `tasks.json` 或 `launch.json`,构建与运行仍走 `running-build.sh`。
|
|
32
32
|
|
|
33
33
|
## 情况
|
|
34
34
|
|
|
35
|
-
**新工程**:从 `../assets/config/` 复制 `.clang-format`、`.clang-tidy`、`.clangd` 和 `.vscode/` 下的 `extensions.json`、`settings.json`,按编译器的映射改 `.clangd` 的编译数据库目录、`.vscode/settings.json` 的 `--query-driver` 路径和 `cmake.debugConfig` 的调试后端。新工程模板自带 `.vscode/` 时按
|
|
35
|
+
**新工程**:从 `../assets/config/` 复制 `.clang-format`、`.clang-tidy`、`.clangd` 和 `.vscode/` 下的 `extensions.json`、`settings.json`,按编译器的映射改 `.clangd` 的编译数据库目录、`.vscode/settings.json` 的 `--query-driver` 路径和 `cmake.debugConfig` 的调试后端。新工程模板自带 `.vscode/` 时按 `04-vscode.md` 接线;已有工程没有 `.vscode/` 时不新建。不要复制 `build/`。
|
|
36
36
|
|
|
37
37
|
**已有工程**:新工程默认 C++23;已有工程按 `environment.json` 的 `standard` 对齐 CMake target 与 `.clang-format`,不要只改一处。先跑一次 `clang-format --dry-run --Werror` 和 `clang-tidy`,看现有配置实际报什么;只改导致当前失败或与声明环境冲突的项。不要借机重排全工程格式。
|
|
38
38
|
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
|
|
41
41
|
**GCC 模式**:`clangd` 仍可工作,但系统头来自 GCC;`--query-driver` 指向 `g++`。`clang-format` / `clang-tidy` 仍是 Clang 工具,版本要求不因编译器是 GCC 而降低。
|
|
42
42
|
|
|
43
|
-
**共享库**:静态检查不因链接方式改变;运行时库路径由 `engineering` 的 target 设置负责,见 `../../engineering/references/cmake/targets/rules.md` 的「共享库运行时路径」,不写进 clang 配置。
|
|
43
|
+
**共享库**:静态检查不因链接方式改变;运行时库路径由 `engineering` 的 target 设置负责,见 `../../engineering/references/cmake/targets/01-target-rules.md` 的「共享库运行时路径」,不写进 clang 配置。
|
|
44
44
|
|
|
45
45
|
## 正反例指针
|
|
46
46
|
|
|
47
|
-
- `.clangd` 指错编译数据库、`query-driver` 写进 YAML:`../../engineering/references/formatting/examples/clangd.md`。
|
|
48
|
-
-
|
|
47
|
+
- `.clangd` 指错编译数据库、`query-driver` 写进 YAML:`../../engineering/references/formatting/examples/03-clangd.md`。
|
|
48
|
+
- 配置文件堆策略头、整族关闭检查:`../../engineering/references/formatting/examples/01-clang-format.md` 与 `../../engineering/references/formatting/examples/02-clang-tidy.md`。
|
|
49
49
|
- 工具调用与头文件过滤:`../../engineering/references/formatting/03-clang-tidy.md`。
|
|
50
|
-
- 每个标准对应的 clang-format 档位与 `.clangd` 读库规则:`../../engineering/references/cmake/standards/
|
|
51
|
-
-
|
|
50
|
+
- 每个标准对应的 clang-format 档位与 `.clangd` 读库规则:`../../engineering/references/cmake/standards/index.md`。
|
|
51
|
+
- 编辑器扩展与设置:`04-vscode.md`。
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
1. **校验编码与行尾**:在仓库根跑编码检查。默认 UTF-8 无 BOM、LF;MSVC 原生工程加 `--profile msvc`。有问题先按 `../../engineering/references/formatting/01-encoding.md` 修正,不带着 BOM 或混用行尾继续;脚本退出码为 0 后再跑 `git diff --check`,有空白错误同样停在这里。
|
|
12
12
|
2. **校验环境声明(不带 `--live`)**:读 `environment.json`,检查三个环境轴、`standard` 和组合是否合法。三个环境轴为空、`standard` 取值不在 `c++11`–`c++23` 内或组合非法时,停在这里,不找可执行文件;`standard` 缺失或为空时按默认 `c++23` 继续并提示声明升级。
|
|
13
13
|
3. **活动校验**:在声明的 build host 上跑 `--live`,核对 PATH 中的角色和版本。`windows` + `native` 在声明校验阶段就返回失败,不会进入这一步。
|
|
14
|
-
4. **跑项目入口命令**:项目技能里写的入口命令(如 `./running-build.sh clang`)。入口命令仍是 `<entry-command>` 或空白时,停在这里,不要猜命令;是真实命令才跑。入口内部依次 configure → build → ctest → run;每一步失败都保留原始输出。有 `tests/` 目录时,脚本里的 ctest 必须带 `--output-on-failure --no-tests=error`;缺参数时按 `ctest --test-dir build/<compiler> --output-on-failure --no-tests=error` 补跑,并以补跑的退出码为准;没有测试目录时按「没有测试」情形处理,不补 `--no-tests=error`。入口通过后,再对项目源码跑 `clang-format --dry-run --Werror` 与 `clang-tidy -p build/<compiler> --header-filter="^$(pwd -P)/(include|src|
|
|
14
|
+
4. **跑项目入口命令**:项目技能里写的入口命令(如 `./running-build.sh clang`)。入口命令仍是 `<entry-command>` 或空白时,停在这里,不要猜命令;是真实命令才跑。入口内部依次 configure → build → ctest → run;每一步失败都保留原始输出。有 `tests/` 目录时,脚本里的 ctest 必须带 `--output-on-failure --no-tests=error`;缺参数时按 `ctest --test-dir build/<compiler> --output-on-failure --no-tests=error` 补跑,并以补跑的退出码为准;没有测试目录时按「没有测试」情形处理,不补 `--no-tests=error`。入口通过后,再对项目源码跑 `clang-format --dry-run --Werror` 与 `clang-tidy -p build/<compiler> --header-filter="^$(pwd -P)/(include|src|app|tests)/" --warnings-as-errors='*'`;任一非零即失败,命令细节见 `../../engineering/references/formatting/02-clang-format.md` 与 `03-clang-tidy.md`。
|
|
15
15
|
5. **核对产物**:`build/<compiler>/compile_commands.json` 存在;`build/compile_commands.json` 指向当前编译器;`app` 可执行文件在 `build/<compiler>/bin`。对 `app` 跑 `file` 与 `ldd`(macOS 用 `otool -L`),`ldd` 不得出现 `not found`,并做一次最小启动;见 `../../engineering/references/cmake/linking/04-inspect.md`。
|
|
16
16
|
6. **记录结果**:通过时记录编译器版本、构建目录、测试数量;失败时记录命令、退出码、第一条根因诊断。
|
|
17
17
|
|
|
18
18
|
编码检查与环境校验脚本(`<skill-dir>` 换成插件里 `building-cpp` 的实际目录):
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
node "<skill-dir>/../engineering/
|
|
21
|
+
node "<skill-dir>/../engineering/scripts/checking-encoding.mjs" --profile portable # UTF-8 无 BOM、LF
|
|
22
22
|
node "<skill-dir>/scripts/checking-environment.mjs" --project . # 声明校验
|
|
23
23
|
node "<skill-dir>/scripts/checking-environment.mjs" --project . --live # 活动校验
|
|
24
24
|
```
|
|
@@ -45,11 +45,11 @@ node "<skill-dir>/scripts/checking-environment.mjs" --project . --live # 活
|
|
|
45
45
|
|
|
46
46
|
**只改源码**:仍跑完整入口命令;CTest 可能暴露声明层问题,不要只看编译通过。
|
|
47
47
|
|
|
48
|
-
**改过 C++ 源码**:再按 `../../engineering/references/cmake/testing/ctest.md` 的运行顺序第 4 条,用 `-fsanitize=address,undefined -fno-omit-frame-pointer` 重新 configure 并跑一轮 CTest;报告按第一条栈帧定位,不靠猜。
|
|
48
|
+
**改过 C++ 源码**:再按 `../../engineering/references/cmake/testing/01-ctest.md` 的运行顺序第 4 条,用 `-fsanitize=address,undefined -fno-omit-frame-pointer` 重新 configure 并跑一轮 CTest;报告按第一条栈帧定位,不靠猜。
|
|
49
49
|
|
|
50
50
|
**只改配置**:至少跑一次完整构建 + CTest;配置错误常常在链接或测试阶段才暴露。
|
|
51
51
|
|
|
52
|
-
**没有测试**:项目确实还没有测试时,CTest 显示 0 条不算构建失败;不要为了「全绿」造空测试。已有公开行为却没有任何用例时,按 `../../engineering/references/cmake/testing/ctest.md` 的「先决定测什么」补成功与拒绝各一条,再跑 `--no-tests=error` 确认它真的被注册。
|
|
52
|
+
**没有测试**:项目确实还没有测试时,CTest 显示 0 条不算构建失败;不要为了「全绿」造空测试。已有公开行为却没有任何用例时,按 `../../engineering/references/cmake/testing/01-ctest.md` 的「先决定测什么」补成功与拒绝各一条,再跑 `--no-tests=error` 确认它真的被注册。
|
|
53
53
|
|
|
54
54
|
**Windows 原生**:本版本不支持 `host=windows` + `build_host=native`。声明校验会返回 `ok: false`,`issues` 只有一句「本版本不能在 Windows 原生壳里构建」。停在这里,不要伪造 PowerShell 脚本,不要建议改 WSL 来绕过,也不要让代理改 `environment.json` 过关。
|
|
55
55
|
|
|
@@ -58,5 +58,5 @@ node "<skill-dir>/scripts/checking-environment.mjs" --project . --live # 活
|
|
|
58
58
|
## 正反例指针
|
|
59
59
|
|
|
60
60
|
- 环境组合与 `--live` 输出:`../examples/environment.md`。
|
|
61
|
-
- 失败分诊的具体命令:`../references/build-script.md`「失败分诊」。
|
|
61
|
+
- 失败分诊的具体命令:`../references/01-build-script.md`「失败分诊」。
|
|
62
62
|
- 工具调用细节:`../../engineering/references/formatting/03-clang-tidy.md`。
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 第 4 步:VS Code 接线
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
只在工程已经有 `.vscode/` 时读本页;从当前目录向上到 git 根都没有 `.vscode/` 时,不打开本页,也不新建目录。新工程从 `../assets/config/.vscode/` 复制时除外。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 三个角色
|
|
6
|
+
|
|
7
|
+
| 扩展 | 负责 | 不负责 |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `llvm-vs-code-extensions.vscode-clangd` | 补全、跳转、诊断、格式化 | 配置与构建 |
|
|
10
|
+
| `ms-vscode.cmake-tools` | 配置、构建、运行、调试入口 | 语言服务 |
|
|
11
|
+
| `ms-vscode.cpptools` | 只作为 `CMake: Debug` 的调试后端 | IntelliSense 与格式化(关闭) |
|
|
12
|
+
|
|
13
|
+
不要同时开两套语言服务;C/C++ 扩展的 IntelliSense 必须关闭,否则会和 clangd 抢编译数据库。
|
|
14
|
+
|
|
15
|
+
## 对照现有文件
|
|
16
|
+
|
|
17
|
+
1. 读工程根 `.vscode/extensions.json`;已有推荐只补缺,不重排、不删除。
|
|
18
|
+
2. 旧工程只写了 C/C++ 扩展时,加 clangd 与 CMake Tools,并在设置里关掉 IntelliSense,理由写在提交说明里。
|
|
19
|
+
3. 不写 `tasks.json` 或 `launch.json`;配置、构建、运行和调试都从 CMake Tools 进入,构建命令仍以 `running-build.sh` 为准。
|
|
20
|
+
4. 模板在 `../assets/config/.vscode/extensions.json`,只作为新工程的起点;工程已有文件时不复制整份覆盖。
|
|
6
21
|
|
|
7
22
|
## 复制后改三处
|
|
8
23
|
|
|
@@ -12,7 +27,7 @@
|
|
|
12
27
|
| `clangd.arguments` 的 `--query-driver` | `/usr/bin/clang++` | `/usr/bin/g++` |
|
|
13
28
|
| `cmake.debugConfig` | `MIMode: lldb`、`miDebuggerPath: /usr/bin/lldb` | `MIMode: gdb`、`miDebuggerPath: /usr/bin/gdb` |
|
|
14
29
|
|
|
15
|
-
只改与 `environment.json` 冲突的键;其余保持工程原值。`.clangd` 的 `CompilationDatabase` 也随编译器改,见
|
|
30
|
+
只改与 `environment.json` 冲突的键;其余保持工程原值。`.clangd` 的 `CompilationDatabase` 也随编译器改,见 `../../engineering/references/formatting/04-clangd.md`。
|
|
16
31
|
|
|
17
32
|
## 各键分工
|
|
18
33
|
|
|
@@ -30,10 +45,13 @@
|
|
|
30
45
|
- 不在设置里堆 `-I` / `-D` 或系统头路径;这些从 `compile_commands.json` 来。
|
|
31
46
|
- 注释用 JSONC 的 `//`,只写为什么这样设。
|
|
32
47
|
|
|
33
|
-
下一步:设置与扩展对齐后,回到 [定工具配置](../../steps/02-tooling.md) 收尾,再进 [通过检查](../../steps/03-check.md)。
|
|
34
|
-
|
|
35
48
|
## 依据
|
|
36
49
|
|
|
50
|
+
- [clangd: Editor Plugins](https://clangd.llvm.org/installation#editor-plugins):VS Code 的 clangd 扩展与语言服务。
|
|
51
|
+
- [CMake Tools for VS Code](https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/README.md):配置、构建、调试入口。
|
|
52
|
+
- [VS Code: Extension Recommendations](https://code.visualstudio.com/docs/editor/extension-marketplace#_workspace-recommended-extensions):`extensions.json` 的 `recommendations`。
|
|
37
53
|
- [clangd: Configuration](https://clangd.llvm.org/config):`.clangd` 与 `clangd.arguments`。
|
|
38
54
|
- [CMake Tools: Settings](https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/cmake-settings.md):`cmake.buildDirectory`、`cmake.generator`、`cmake.exportCompileCommandsFile`。
|
|
39
55
|
- [VS Code: Debugging](https://code.visualstudio.com/docs/debugtest/debugging):`cppdbg` 调试配置与 `miDebuggerPath`。
|
|
56
|
+
|
|
57
|
+
下一步:扩展与设置对齐后,回到 [定工具配置](02-tooling.md) 收尾,再进 [通过检查](03-check.md)。
|