@chengzhao-dev/dsh-cpp-workflow 0.1.0 → 0.2.0
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/LICENSE +20 -20
- package/README.en.md +18 -16
- package/README.md +18 -16
- package/cordis.patch.yml +2 -5
- package/lib/index.js +7 -8
- package/lib/workspace.js +14 -14
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +5 -5
- package/skills/building-cpp/SKILL.md +6 -6
- package/skills/building-cpp/assets/config/.clang-format +3 -38
- package/skills/building-cpp/assets/config/.clang-tidy +8 -39
- package/skills/building-cpp/assets/config/.clangd +2 -5
- package/skills/building-cpp/assets/config/.vscode/extensions.json +2 -1
- package/skills/building-cpp/assets/config/.vscode/settings.json +16 -1
- package/skills/building-cpp/assets/templates/projects/common/running-build.sh +29 -18
- package/skills/building-cpp/assets/templates/projects/multi/CMakeLists.txt +9 -5
- package/skills/building-cpp/assets/templates/projects/multi/include/greeting.h +5 -3
- package/skills/building-cpp/assets/templates/projects/multi/src/greeting.cc +18 -0
- package/skills/building-cpp/assets/templates/projects/multi/src/main.cc +8 -0
- package/skills/building-cpp/assets/templates/projects/shared-library/CMakeLists.txt +8 -3
- package/skills/building-cpp/assets/templates/projects/shared-library/greeting/CMakeLists.txt +15 -5
- package/skills/building-cpp/assets/templates/projects/shared-library/greeting/include/greeting.h +5 -3
- package/skills/building-cpp/assets/templates/projects/shared-library/greeting/src/greeting.cc +18 -0
- package/skills/building-cpp/assets/templates/projects/shared-library/src/main.cc +8 -0
- package/skills/building-cpp/assets/templates/projects/single/CMakeLists.txt +7 -3
- package/skills/building-cpp/assets/templates/projects/single/src/main.cc +15 -0
- package/skills/building-cpp/assets/templates/projects/static-library/CMakeLists.txt +8 -3
- package/skills/building-cpp/assets/templates/projects/static-library/greeting/CMakeLists.txt +15 -5
- package/skills/building-cpp/assets/templates/projects/static-library/greeting/include/greeting.h +5 -3
- package/skills/building-cpp/assets/templates/projects/static-library/greeting/src/greeting.cc +18 -0
- package/skills/building-cpp/assets/templates/projects/static-library/src/main.cc +8 -0
- package/skills/building-cpp/examples/cmake.md +17 -17
- package/skills/building-cpp/examples/environment.md +4 -3
- package/skills/building-cpp/examples/tooling.md +31 -16
- package/skills/building-cpp/references/build-script.md +2 -2
- package/skills/building-cpp/references/cmake.md +35 -17
- package/skills/building-cpp/references/environment.md +17 -13
- package/skills/building-cpp/references/linking.md +6 -6
- package/skills/building-cpp/references/standards/README.md +165 -0
- package/skills/building-cpp/references/standards/c++11/README.md +50 -0
- package/skills/building-cpp/references/standards/c++11/cmake-snippet.cmake +7 -0
- package/skills/building-cpp/references/standards/c++14/README.md +48 -0
- package/skills/building-cpp/references/standards/c++14/cmake-snippet.cmake +7 -0
- package/skills/building-cpp/references/standards/c++17/README.md +49 -0
- package/skills/building-cpp/references/standards/c++17/cmake-snippet.cmake +7 -0
- package/skills/building-cpp/references/standards/c++20/README.md +49 -0
- package/skills/building-cpp/references/standards/c++20/cmake-snippet.cmake +7 -0
- package/skills/building-cpp/references/standards/c++23/README.md +50 -0
- package/skills/building-cpp/references/standards/c++23/cmake-snippet.cmake +7 -0
- package/skills/building-cpp/references/static-analysis.md +27 -15
- package/skills/building-cpp/scripts/checking-environment.mjs +21 -21
- package/skills/building-cpp/steps/01-build.md +78 -76
- package/skills/building-cpp/steps/02-tooling.md +43 -41
- package/skills/building-cpp/steps/03-check.md +60 -60
- package/skills/developing-cpp/SKILL.md +6 -6
- package/skills/developing-cpp/examples/comments.md +10 -8
- package/skills/developing-cpp/examples/exceptions.md +64 -45
- package/skills/developing-cpp/examples/naming.md +2 -2
- package/skills/developing-cpp/examples/structure.md +12 -9
- package/skills/developing-cpp/references/comments.md +10 -8
- package/skills/developing-cpp/references/declaration-order.md +7 -4
- package/skills/developing-cpp/references/exceptions.md +83 -46
- package/skills/developing-cpp/references/glossary.md +6 -6
- package/skills/developing-cpp/references/google-cpp-style.md +27 -37
- package/skills/developing-cpp/references/language.md +4 -4
- package/skills/developing-cpp/references/layout.md +14 -14
- package/skills/developing-cpp/references/naming.md +7 -6
- package/skills/developing-cpp/references/project-design.md +3 -3
- package/skills/developing-cpp/references/standard-library.md +1 -1
- package/skills/developing-cpp/steps/02-boundary.md +7 -7
- package/skills/developing-cpp/steps/03-declaration.md +9 -8
- package/skills/developing-cpp/steps/04-implementation.md +11 -7
- package/templates/cpp-workflow-project/SKILL.md +1 -1
- package/templates/cpp-workflow-project/environment.json +2 -1
- package/skills/building-cpp/assets/templates/projects/multi/src/greeting.cpp +0 -13
- package/skills/building-cpp/assets/templates/projects/multi/src/main.cpp +0 -8
- package/skills/building-cpp/assets/templates/projects/shared-library/greeting/src/greeting.cpp +0 -13
- package/skills/building-cpp/assets/templates/projects/shared-library/src/main.cpp +0 -8
- package/skills/building-cpp/assets/templates/projects/single/src/main.cpp +0 -9
- package/skills/building-cpp/assets/templates/projects/static-library/greeting/src/greeting.cpp +0 -13
- package/skills/building-cpp/assets/templates/projects/static-library/src/main.cpp +0 -8
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 chengzhao-dev
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 chengzhao-dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.en.md
CHANGED
|
@@ -2,41 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
[中文](README.md)
|
|
4
4
|
|
|
5
|
-
Two skills for C++
|
|
5
|
+
Two skills for C++11–C++23 source and build work; new projects default to C++23. The plugin registers a skill provider only; it does not register tools, compile, download a toolchain, or write project files.
|
|
6
6
|
|
|
7
7
|
## What it provides
|
|
8
8
|
|
|
9
9
|
| Skill | Covers | Open it when |
|
|
10
10
|
| --- | --- | --- |
|
|
11
|
-
| `developing-cpp` | Behavior, boundaries, declarations, implementation; naming, exceptions, and source comments in `.h` / `.
|
|
11
|
+
| `developing-cpp` | Behavior, boundaries, declarations, implementation; naming, exceptions, and source comments in `.h` / `.cc` | The user names source code, or the work is a new project or whole-stage refactor |
|
|
12
12
|
| `building-cpp` | Build setup, tool configuration, checks; CMake, Ninja, Clang config, build scripts, and environment combinations | The change touches build files, tool config, or the environment declaration, or the project is first connected to a build |
|
|
13
13
|
|
|
14
|
-
Both skills read the project skill `cpp-workflow-project` first. Without it, the workspace gate never exposes these names.
|
|
14
|
+
The exception material follows the C++ Core Guidelines' Error handling section and guides source and examples only during development; the plugin runtime never compiles or executes those rules. Both skills read the project skill `cpp-workflow-project` first. Without it, the workspace gate never exposes these names.
|
|
15
15
|
|
|
16
16
|
## Install
|
|
17
17
|
|
|
18
18
|
Pinned npm install:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
dsh plugin --profile web add npm:@chengzhao-dev/dsh-cpp-workflow@0.
|
|
21
|
+
dsh plugin --profile web add npm:@chengzhao-dev/dsh-cpp-workflow@0.2.0
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
The matching Git tag:
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
dsh plugin --profile web add github:chengzhao-dev/dsh-cpp-workflow#v0.
|
|
27
|
+
dsh plugin --profile web add github:chengzhao-dev/dsh-cpp-workflow#v0.2.0
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
The desktop app owns the `desktop` profile. 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.
|
|
31
31
|
|
|
32
32
|
## Workspace gate
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Only one condition must hold before either skill appears: walking up from the current directory to the Git root, the path contains `.agents/skills/cpp-workflow-project/SKILL.md`.
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
2. Inside the same Git repository that owns the marker, outside the skipped directories, there is a first-party `CMakeLists.txt`, or a `.c`, `.cc`, `.cpp`, `.cxx`, `.h`, `.hh`, `.hpp`, or `.hxx` source file.
|
|
38
|
-
|
|
39
|
-
If either condition fails, the list is empty: without the project skill, CMake or `.cpp` files alone do not match; with the project skill but no first-party CMake or C++ source file in the repository, the result is also empty. A docs-only repository or one that only copied the template does not match. Scan limits, skipped directories, and the eight boundary cases are in [docs/plugin-boundaries.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-boundaries.md).
|
|
36
|
+
The project skill marker is the repository's opt-in declaration. The plugin no longer requires a first-party `CMakeLists.txt` or C++ source file in the same repository: a docs-only repository, a repository that only copied the template, or a repository with no source files yet still matches; with an empty environment axis, the four source steps still work but build setup stops. Without the marker the list is empty, even when the repository contains CMake or `.cpp` files. Scan limits and boundary cases are in [docs/plugin-boundaries.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-boundaries.md).
|
|
40
37
|
|
|
41
38
|
The packaged skills use rank 550. A project `.agents/skills` skill uses rank 200 and overrides a plugin skill with the same name; do not copy `developing-cpp` or `building-cpp` into a project.
|
|
42
39
|
|
|
@@ -49,7 +46,7 @@ Copy [templates/cpp-workflow-project](templates/cpp-workflow-project) into the t
|
|
|
49
46
|
- an entry command that runs from the repository root;
|
|
50
47
|
- stage-table path and terminology additions.
|
|
51
48
|
|
|
52
|
-
Keep one `environment.json` per repository. Its three axes are intentionally empty in the template and must be filled with the project's real combination after copying;
|
|
49
|
+
Keep one `environment.json` per repository. Its first three environment axes are intentionally empty in the template and must be filled with the project's real combination after copying; `standard` defaults to `c++23` and may be changed to `c++11`–`c++23`. While the axes are empty, the four source steps still work, but build setup stops. The stage table records observable behavior, not internal refactors.
|
|
53
50
|
|
|
54
51
|
## Environment combinations
|
|
55
52
|
|
|
@@ -58,6 +55,9 @@ Keep one `environment.json` per repository. Its three axes are intentionally emp
|
|
|
58
55
|
| `host` | `windows`, `linux`, `macos` | Where the editor and agent shell run |
|
|
59
56
|
| `build_host` | `native`, `wsl` | `wsl` is valid only with `host=windows` |
|
|
60
57
|
| `compiler` | `clang`, `gcc` | One compiler per configuration |
|
|
58
|
+
| `standard` | `c++11`, `c++14`, `c++17`, `c++20`, `c++23` | New projects default to `c++23`; one standard per project |
|
|
59
|
+
|
|
60
|
+
The standard lives in `environment.json` as `standard` and must match the CMake target and compile database. 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/building-cpp/references/standards/README.md).
|
|
61
61
|
|
|
62
62
|
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.
|
|
63
63
|
|
|
@@ -68,7 +68,9 @@ node "<skill-dir>/scripts/checking-environment.mjs" --project .
|
|
|
68
68
|
node "<skill-dir>/scripts/checking-environment.mjs" --project . --live
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
`windows + native` is a valid combination
|
|
71
|
+
`windows + native` is not a valid combination in this version: the declaration check returns `ok: false` with the single issue `本版本不能在 Windows 原生壳里构建`. Stop there; do not add a PowerShell script or work around it by editing the declaration. The checker never installs, downloads, or edits PATH.
|
|
72
|
+
|
|
73
|
+
The project root carries only `.vscode/extensions.json` and `settings.json`: clangd (editing, completion, formatting), CMake Tools (the single configure/build/run/debug entry point), and the C/C++ extension (debug backend for CMake quick debugging only). There is no `tasks.json` or `launch.json`, so there is no second build or launch path. On Windows, open the project root through Remote - WSL; select the launch target in the CMake sidebar and run `CMake: Debug`. clangd reads the language standard from `build/<compiler>/compile_commands.json`; do not put `-std` in `.clangd`. The C/C++ extension's IntelliSense is disabled so editing and diagnostics come only from clangd.
|
|
72
74
|
|
|
73
75
|
## Package layout
|
|
74
76
|
|
|
@@ -95,12 +97,12 @@ Requires Node.js 22 or newer.
|
|
|
95
97
|
|
|
96
98
|
```bash
|
|
97
99
|
npm ci
|
|
98
|
-
npm test
|
|
99
|
-
npm run
|
|
100
|
-
npm run pack:check
|
|
100
|
+
npm test # build, structural check, gate/environment/schema tests
|
|
101
|
+
npm run test:matrix # real build matrix: 4 templates x 5 standards
|
|
102
|
+
npm run pack:check # inspect the npm package contents
|
|
101
103
|
```
|
|
102
104
|
|
|
103
|
-
Source lives in `src/`; `npm run build` writes `lib/`. The structural check is `scripts/checking-skill-links.mjs`. Tests do not invoke a local compiler; the environment checks use fixed version strings.
|
|
105
|
+
Source lives in `src/`; `npm run build` writes `lib/`. The structural check is `scripts/checking-skill-links.mjs`. Tests do not invoke a local compiler; the environment checks use fixed version strings. The standard matrix needs `cmake`, `ninja`, `perl`, and `clang++` (or the compiler named by `CXX`) on a POSIX host such as WSL, Linux, or macOS.
|
|
104
106
|
|
|
105
107
|
## License
|
|
106
108
|
|
package/README.md
CHANGED
|
@@ -2,41 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.en.md)
|
|
4
4
|
|
|
5
|
-
把 C++
|
|
5
|
+
把 C++11–C++23 的源码工作和构建工作收成两个技能,新工程默认 C++23。插件只注册技能 provider,不注册工具、不编译、不下载工具链、不写项目文件。
|
|
6
6
|
|
|
7
7
|
## 提供什么
|
|
8
8
|
|
|
9
9
|
| 技能 | 管什么 | 什么时候打开 |
|
|
10
10
|
| --- | --- | --- |
|
|
11
|
-
| `developing-cpp` | 定行为、定边界、定声明、定实现;`.h` / `.
|
|
11
|
+
| `developing-cpp` | 定行为、定边界、定声明、定实现;`.h` / `.cc` 的命名、异常和源码注释 | 用户点名源码,或需要新建/整段重构源码 |
|
|
12
12
|
| `building-cpp` | 定构建、定工具配置、通过检查;CMake、Ninja、Clang 配置、构建脚本和环境组合 | 改动落在构建文件、工具配置或环境声明上,或第一次接构建 |
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
异常条文采用 C++ Core Guidelines 的 Error handling,只在开发阶段指导源码和示例;插件运行时不编译、不执行这些规则。两个技能都先读项目技能 `cpp-workflow-project`。没有项目技能时,门禁不会放出这两个名字。
|
|
15
15
|
|
|
16
16
|
## 安装
|
|
17
17
|
|
|
18
18
|
npm 安装钉死版本:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
dsh plugin --profile web add npm:@chengzhao-dev/dsh-cpp-workflow@0.
|
|
21
|
+
dsh plugin --profile web add npm:@chengzhao-dev/dsh-cpp-workflow@0.2.0
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
同版本的 Git 标签:
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
dsh plugin --profile web add github:chengzhao-dev/dsh-cpp-workflow#v0.
|
|
27
|
+
dsh plugin --profile web add github:chengzhao-dev/dsh-cpp-workflow#v0.2.0
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
桌面应用独占 `desktop` profile。命令行 `add` 被拒绝时,在应用设置里添加插件,地址填同一个 npm 版本。Git 标签安装使用仓库内已构建的 `lib/`,不在目标机器上重新构建;包内也不含需要授权执行的安装脚本。
|
|
31
31
|
|
|
32
32
|
## 工作区门禁
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
一个会话里只需要满足一件事,技能就会出现:从当前目录向上、停在 git 根,沿途有 `.agents/skills/cpp-workflow-project/SKILL.md`。
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
2. 这份标记所在的 git 仓库里,跳过目录之外,有第一方 `CMakeLists.txt`,或有 `.c`、`.cc`、`.cpp`、`.cxx`、`.h`、`.hh`、`.hpp`、`.hxx` 源文件。
|
|
38
|
-
|
|
39
|
-
缺一件就返回空列表:没有项目技能时,即使仓库里有 CMake 或 `.cpp` 也不命中;有项目技能、但仓库里没有第一方 CMake 或 C++ 源文件,同样不命中。纯文档仓库、只复制了模板的仓库也不命中。扫描上限、跳过目录和八类边界情形见 [docs/plugin-boundaries.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-boundaries.md)。
|
|
36
|
+
项目技能标记就是仓库选择加入本工作流的声明。插件不再要求同一仓库里已经有第一方 `CMakeLists.txt` 或 C++ 源文件:纯文档仓库、只复制了模板、还没有任何源文件的仓库也会出现;环境轴为空时,源码四步仍能做,但定构建会停。没有标记就返回空列表,即使仓库里有 CMake 或 `.cpp`。扫描上限和边界情形见 [docs/plugin-boundaries.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-boundaries.md)。
|
|
40
37
|
|
|
41
38
|
插件技能 rank 550。项目自己的 `.agents/skills` 技能 rank 200,会以同名覆盖插件;不要在项目里复制 `developing-cpp` 或 `building-cpp`。
|
|
42
39
|
|
|
@@ -49,7 +46,7 @@ dsh plugin --profile web add github:chengzhao-dev/dsh-cpp-workflow#v0.1.0
|
|
|
49
46
|
- 从仓库根能直接运行的入口命令;
|
|
50
47
|
- 阶段表路径和术语增补。
|
|
51
48
|
|
|
52
|
-
`environment.json`
|
|
49
|
+
`environment.json` 一个仓库只有一份。模板里的前三个环境轴故意留空,`standard` 预置为 `c++23`;复制后把环境轴填成工程的真实组合,需要旧标准时再改 `standard`。环境轴留空时源码四步仍能做,但定构建会停。阶段表只写可观察行为,不写内部重构。
|
|
53
50
|
|
|
54
51
|
## 环境组合
|
|
55
52
|
|
|
@@ -58,6 +55,9 @@ dsh plugin --profile web add github:chengzhao-dev/dsh-cpp-workflow#v0.1.0
|
|
|
58
55
|
| `host` | `windows`、`linux`、`macos` | 编辑器和代理壳在哪 |
|
|
59
56
|
| `build_host` | `native`、`wsl` | `wsl` 只在 `host=windows` 时合法 |
|
|
60
57
|
| `compiler` | `clang`、`gcc` | 一次配置一个编译器 |
|
|
58
|
+
| `standard` | `c++11`、`c++14`、`c++17`、`c++20`、`c++23` | 新工程默认 `c++23`;一个工程一个标准 |
|
|
59
|
+
|
|
60
|
+
标准写在 `environment.json` 的 `standard`,并同步到 CMake target 和编译数据库。新工程默认 C++23;C++11–C++20 工程把 `standard`、`cxx_std_*`、`CXX_STANDARD` 和 `.clang-format` 的解析档位一起降级,不要只改一处。每档的设施、工具和降档表见 [标准目录](skills/building-cpp/references/standards/README.md)。
|
|
61
61
|
|
|
62
62
|
生成器固定 Ninja,构建目录是 `build/clang/` 与 `build/gcc/`,不共用 `build/`。诊断工具固定 `clang-format`、`clang-tidy`、`clangd`;GCC 模式也不换成别的分析器。
|
|
63
63
|
|
|
@@ -68,7 +68,9 @@ node "<skill-dir>/scripts/checking-environment.mjs" --project .
|
|
|
68
68
|
node "<skill-dir>/scripts/checking-environment.mjs" --project . --live
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
`windows + native`
|
|
71
|
+
`windows + native` 在本版本中不是合法组合:声明校验直接返回 `ok: false`,`issues` 只有一句「本版本不能在 Windows 原生壳里构建」。停在这里,不要补 PowerShell 脚本,也不要靠改声明绕过。环境脚本不安装、不下载、不改 PATH。
|
|
72
|
+
|
|
73
|
+
工程根只带 `.vscode/extensions.json` 和 `settings.json`:推荐 clangd(编辑、补全、格式化)、CMake Tools(唯一的配置、构建、运行和调试入口)与 C/C++ 扩展(只作为 CMake 快速调试的后端)。不提供 `tasks.json` 或 `launch.json`,不维护第二套构建或启动路径。Windows 上用 Remote - WSL 打开工程根;在 CMake 侧栏选中 Launch target 后按 `CMake: Debug`。clangd 从 `build/<compiler>/compile_commands.json` 读语言标准,`.clangd` 不写 `-std`;C/C++ 扩展的 IntelliSense 关闭,编辑与诊断只由 clangd 提供。
|
|
72
74
|
|
|
73
75
|
## 包结构
|
|
74
76
|
|
|
@@ -95,12 +97,12 @@ dsh-cpp-workflow/
|
|
|
95
97
|
|
|
96
98
|
```bash
|
|
97
99
|
npm ci
|
|
98
|
-
npm test
|
|
99
|
-
npm run
|
|
100
|
-
npm run pack:check
|
|
100
|
+
npm test # 构建、结构检查、门禁/环境/schema 测试
|
|
101
|
+
npm run test:matrix # 四套模板 × 五档标准的真实构建矩阵
|
|
102
|
+
npm run pack:check # 核对 npm 包内容
|
|
101
103
|
```
|
|
102
104
|
|
|
103
|
-
源码在 `src/`,`npm run build` 生成 `lib/`。结构检查在 `scripts/checking-skill-links.mjs
|
|
105
|
+
源码在 `src/`,`npm run build` 生成 `lib/`。结构检查在 `scripts/checking-skill-links.mjs`;测试不调用本机编译器,环境检查用固定版本字符串。标准矩阵需要 POSIX 宿主上的 `cmake`、`ninja`、`perl` 和 `clang++`(或 `CXX` 指定的编译器),在 WSL/Linux/macOS 上运行。
|
|
104
106
|
|
|
105
107
|
## 许可
|
|
106
108
|
|
package/cordis.patch.yml
CHANGED
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
# replaced. The row loads this package's `main` entry, which registers the
|
|
5
5
|
# packaged developing-cpp and building-cpp skills through `ctx.skills`.
|
|
6
6
|
#
|
|
7
|
-
# Install
|
|
8
|
-
#
|
|
9
|
-
# dsh plugin --profile web add npm:@chengzhao-dev/dsh-cpp-workflow@0.1.0
|
|
10
|
-
# dsh plugin --profile web add github:chengzhao-dev/dsh-cpp-workflow#v0.1.0
|
|
11
|
-
#
|
|
7
|
+
# Install with `dsh plugin --profile <name> add <package>`. Pinned npm and Git
|
|
8
|
+
# tag addresses are in the README's Install section.
|
|
12
9
|
- insert:
|
|
13
10
|
- id: cpp-workflow
|
|
14
11
|
name: "@chengzhao-dev/dsh-cpp-workflow"
|
package/lib/index.js
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
// directory becomes the resourceBase so relative steps, references, examples
|
|
6
6
|
// and assets resolve from the installed package.
|
|
7
7
|
//
|
|
8
|
-
// The provider scopes itself to
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
// sibling directories.
|
|
8
|
+
// The provider scopes itself to opted-in workspaces: `list()` returns nothing
|
|
9
|
+
// unless the session cwd sits inside a git checkout that carries the explicit
|
|
10
|
+
// `.agents/skills/cpp-workflow-project/SKILL.md` marker on the path to the git
|
|
11
|
+
// root. C++ or CMake evidence is intentionally not part of the gate: a freshly
|
|
12
|
+
// copied template has no sources yet, and an empty project legitimately stops
|
|
13
|
+
// at the build step. A C++ sample outside an opted-in checkout never sees these
|
|
14
|
+
// names; the marker lookup ignores sibling directories.
|
|
16
15
|
//
|
|
17
16
|
// Rank 550 is lower priority than project/user skills (project `.agents/skills`
|
|
18
17
|
// 200, user `.agents/skills` 500) and higher priority than the bundled root
|
package/lib/workspace.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Workspace evidence for dsh-cpp-workflow.
|
|
2
2
|
//
|
|
3
3
|
// A repository opts in only when it carries the project skill on the path from
|
|
4
|
-
// the session cwd up to the git root
|
|
5
|
-
// or CMake evidence
|
|
6
|
-
//
|
|
7
|
-
// repository boundary:
|
|
8
|
-
//
|
|
4
|
+
// the session cwd up to the git root. The marker is the opt-in declaration;
|
|
5
|
+
// first-party C++ or CMake evidence is deliberately not part of the gate, so a
|
|
6
|
+
// freshly copied template still sees the workflow. The git root is the
|
|
7
|
+
// repository boundary: marker lookup ignores sibling directories and never
|
|
8
|
+
// searches above the root.
|
|
9
9
|
import { access, readdir } from 'node:fs/promises';
|
|
10
10
|
import path from 'node:path';
|
|
11
11
|
export const PROJECT_SKILL = path.join('.agents', 'skills', 'cpp-workflow-project', 'SKILL.md');
|
|
@@ -66,7 +66,7 @@ export async function findGitRoot(cwd) {
|
|
|
66
66
|
/**
|
|
67
67
|
* Find the nearest project-skill marker between `cwd` and the git root,
|
|
68
68
|
* inclusive. A marker above the git root never counts. The marker's directory
|
|
69
|
-
* is also returned for diagnostics
|
|
69
|
+
* is also returned for diagnostics; it is not the repository boundary.
|
|
70
70
|
*/
|
|
71
71
|
export async function findProjectSkill(cwd, gitRoot) {
|
|
72
72
|
if (typeof cwd !== 'string' || cwd.trim() === '')
|
|
@@ -151,18 +151,18 @@ export async function hasCppProject(root) {
|
|
|
151
151
|
return false;
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
|
-
* Session gate.
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
154
|
+
* Session gate. The project skill must sit between `cwd` and the git root
|
|
155
|
+
* (inclusive). First-party C++ or CMake evidence is deliberately not required:
|
|
156
|
+
* a freshly copied template still needs the workflow, and an empty project
|
|
157
|
+
* legitimately stops at the build step.
|
|
158
|
+
*
|
|
159
|
+
* No cwd, no git checkout, a marker above the git root, or a marker only in a
|
|
160
|
+
* sibling directory returns false.
|
|
159
161
|
*/
|
|
160
162
|
export async function isCppWorkflowWorkspace(cwd) {
|
|
161
163
|
const gitRoot = await findGitRoot(cwd);
|
|
162
164
|
if (!gitRoot)
|
|
163
165
|
return false;
|
|
164
166
|
const project = await findProjectSkill(cwd, gitRoot);
|
|
165
|
-
|
|
166
|
-
return false;
|
|
167
|
-
return hasCppProject(gitRoot);
|
|
167
|
+
return project !== undefined;
|
|
168
168
|
}
|
package/locale/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "C++ Workflow",
|
|
4
|
-
"description": "Four source steps and three build steps for C++
|
|
4
|
+
"description": "Four source steps and three build steps for C++11–C++23 projects (C++23 by default), checked against the environment the project declares."
|
|
5
5
|
}
|
|
6
6
|
}
|
package/locale/zh.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chengzhao-dev/dsh-cpp-workflow",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "C++
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "C++11–C++23 工程流程技能包:源码四步与构建三步,按项目声明的环境组合校验 · C++11–C++23 workflow skills for DeepSeek Harness",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"catalog": {
|
|
32
32
|
"category": "skill",
|
|
33
33
|
"summary": {
|
|
34
|
-
"zh": "按项目声明的环境组合,推进 C++
|
|
35
|
-
"en": "Advance C++
|
|
34
|
+
"zh": "按项目声明的环境组合,推进 C++11–C++23 源码与构建流程",
|
|
35
|
+
"en": "Advance C++11–C++23 source and build work with a project-declared environment"
|
|
36
36
|
},
|
|
37
37
|
"capabilities": [
|
|
38
38
|
"skills"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsc -p tsconfig.json",
|
|
45
45
|
"test": "npm run build && node scripts/checking-skill-links.mjs && node --test tests/*.test.mjs",
|
|
46
|
-
"
|
|
46
|
+
"test:matrix": "bash scripts/checking-standard-matrix.sh",
|
|
47
47
|
"pack:check": "npm pack --dry-run"
|
|
48
48
|
},
|
|
49
49
|
"keywords": [
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: building-cpp
|
|
3
|
-
description: 用 CMake、Ninja、clang-format、clang-tidy、clangd 配置、构建和检查 C++
|
|
3
|
+
description: 用 CMake、Ninja、clang-format、clang-tidy、clangd 配置、构建和检查 C++11–C++23 工程时使用;新工程默认 C++23;按定构建、定工具配置、通过检查三步推进。一次改动同时碰到源码和构建文件时,先打开 developing-cpp。不用于只改源码语义、文档、Python 或与 C++ 无关的文件。
|
|
4
4
|
metadata:
|
|
5
|
-
short-description: C++
|
|
5
|
+
short-description: C++11–C++23 构建三步
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# building-cpp
|
|
9
9
|
|
|
10
10
|
## 适用场景
|
|
11
11
|
|
|
12
|
-
管 `CMakeLists.txt`、`cmake/`、`running-build.sh`、`.clang-format`、`.clang-tidy`、`.clangd`、`.vscode/` 和 `environment.json`。函数体、类型、命名、异常和源码注释只开 `developing-cpp
|
|
12
|
+
管 `CMakeLists.txt`、`cmake/`、`running-build.sh`、`.clang-format`、`.clang-tidy`、`.clangd`、`.vscode/` 和 `environment.json`。函数体、类型、命名、异常和源码注释只开 `developing-cpp`。一次改动同时碰到源码和构建文件时,先打开 `developing-cpp`:只改函数体、命名、异常或注释且入口命令可运行时,定实现后直接到本技能的通过检查;新增或移动源文件、改库与程序的边界、补测试 target 时,到本技能先做定构建,把文件写进 CMake,再决定是否定工具配置,最后通过检查。`.qmd`、仓库 README、Python 和非 C++ 文档不打开本技能。
|
|
13
13
|
|
|
14
14
|
编译失败先分因:诊断指向函数体,回 `developing-cpp` 的定实现;诊断指向声明或类型,回定声明;诊断是找不到头、链接失败、没有编译数据库或工具不在 PATH,留在本技能的定构建或定工具配置。
|
|
15
15
|
|
|
16
|
-
存在项目技能 `cpp-workflow-project` 时先读它的 `SKILL.md`、`environment.json` 和 `stages/stage-table.md
|
|
16
|
+
存在项目技能 `cpp-workflow-project` 时先读它的 `SKILL.md`、`environment.json` 和 `stages/stage-table.md`。三个环境轴为空、`standard` 非法或组合非法时停在定构建,不猜 WSL、Clang 或构建目录;`windows` + `native` 直接拒绝,提示「本版本不能在 Windows 原生壳里构建」,不要给出补 PowerShell 的路线。环境组合空着时源码四步仍可做,只是不能构建。
|
|
17
17
|
|
|
18
18
|
## 两种走法
|
|
19
19
|
|
|
@@ -36,9 +36,9 @@ metadata:
|
|
|
36
36
|
|
|
37
37
|
## 完成判据
|
|
38
38
|
|
|
39
|
-
- 项目 `environment.json`
|
|
39
|
+
- 项目 `environment.json` 的三个环境轴齐全且是合法组合,`standard` 在 `c++11`–`c++23` 内;新工程默认 `c++23`,没有靠猜。
|
|
40
40
|
- 配置命令固定 Ninja 和单一编译器,`build/<compiler>/compile_commands.json` 存在,根 `build/compile_commands.json` 指向当前编译器。
|
|
41
|
-
- 标准写在 target
|
|
41
|
+
- 标准写在 target 上(`CXX_STANDARD` + `CXX_STANDARD_REQUIRED ON` + `cxx_std_*`),`CXX_EXTENSIONS OFF`;`compile_commands.json` 的实际 `-std` 与 `environment.json` 一致,没有全局 `include_directories()` 或 GLOB。
|
|
42
42
|
- `clang-format --dry-run --Werror` 与 `clang-tidy` 在项目源码上零告警;只扫描项目源码和项目头。
|
|
43
43
|
- CTest 全绿,程序从该编译器的构建目录启动;失败时报告的是具体角色和原因。
|
|
44
44
|
- 没有改源码语义,没有覆盖已有工程文件,也没有安装或下载任何工具。
|
|
@@ -1,40 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Google 预设给 80 列、2 空格、不用 tab、包含顺序。
|
|
2
|
+
# clang-format 21/22 不接受 Standard: c++23;Latest 会按当前工具支持的最高标准解析。
|
|
2
3
|
Language: Cpp
|
|
3
4
|
BasedOnStyle: Google
|
|
4
|
-
Standard:
|
|
5
|
-
ColumnLimit: 100
|
|
6
|
-
ReflowComments: true
|
|
7
|
-
AlignAfterOpenBracket: Align
|
|
8
|
-
AlignOperands: Align
|
|
9
|
-
BreakBeforeTernaryOperators: true
|
|
10
|
-
DerivePointerAlignment: false
|
|
11
|
-
PointerAlignment: Left
|
|
12
|
-
AccessModifierOffset: -1
|
|
13
|
-
EmptyLineBeforeAccessModifier: Always
|
|
14
|
-
EmptyLineAfterAccessModifier: Never
|
|
15
|
-
IndentWidth: 2
|
|
16
|
-
TabWidth: 2
|
|
17
|
-
UseTab: Never
|
|
18
|
-
MaxEmptyLinesToKeep: 1
|
|
19
|
-
KeepEmptyLinesAtTheStartOfBlocks: false
|
|
20
|
-
AllowShortFunctionsOnASingleLine: Empty
|
|
21
|
-
AllowShortIfStatementsOnASingleLine: Never
|
|
22
|
-
AllowShortLoopsOnASingleLine: false
|
|
23
|
-
AllowShortCaseLabelsOnASingleLine: false
|
|
24
|
-
BreakAfterAttributes: Never
|
|
25
|
-
AlwaysBreakTemplateDeclarations: Yes
|
|
26
|
-
BreakConstructorInitializers: BeforeColon
|
|
27
|
-
ConstructorInitializerIndentWidth: 4
|
|
28
|
-
SpacesBeforeTrailingComments: 2
|
|
29
|
-
IncludeBlocks: Regroup
|
|
30
|
-
IncludeCategories:
|
|
31
|
-
# C 系统头先于 C++ 标准库;gtest 归第三方,不排到标准库前面。
|
|
32
|
-
- Regex: '^<[^/>]*\.h>'
|
|
33
|
-
Priority: 1
|
|
34
|
-
- Regex: '^<gtest/'
|
|
35
|
-
Priority: 3
|
|
36
|
-
- Regex: '^<.*>'
|
|
37
|
-
Priority: 2
|
|
38
|
-
# 其余引号头(本项目组件头)排最后。
|
|
39
|
-
- Regex: '.*'
|
|
40
|
-
Priority: 4
|
|
5
|
+
Standard: Latest
|
|
@@ -1,35 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
#
|
|
3
|
-
#===--------------------------------------------------------------------------------------------===#
|
|
4
|
-
|
|
1
|
+
# Google C++ Style Guide 是唯一基线。这里只跑 google-* 检查族,再加一条
|
|
2
|
+
# 命名规则;不再整包启用 cppcoreguidelines-*,也不靠本地关闭项维持风格。
|
|
5
3
|
InheritParentConfig: false
|
|
6
4
|
|
|
7
|
-
# 关闭项:
|
|
8
|
-
# - bugprone-easily-swappable-parameters:相邻同型参数的顺序错误靠接口设计和 review,不靠命名噪声。
|
|
9
|
-
# - modernize-use-trailing-return-type:Google 风格不要求尾置返回类型。
|
|
10
|
-
# - portability-avoid-pragma-once:项目统一使用 #pragma once。
|
|
11
|
-
# - readability-identifier-length:短循环变量和测试数据(i、x)是领域习惯。
|
|
12
|
-
# - readability-magic-numbers 与 cppcoreguidelines-avoid-magic-numbers:阈值、尺寸和测试数据常直接写字面量。
|
|
13
5
|
Checks: >
|
|
14
6
|
-*,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
misc-*,
|
|
18
|
-
modernize-*,
|
|
19
|
-
performance-*,
|
|
20
|
-
portability-*,
|
|
21
|
-
readability-*,
|
|
22
|
-
clang-analyzer-core.*,
|
|
23
|
-
google-build-using-namespace,
|
|
24
|
-
google-explicit-constructor,
|
|
25
|
-
google-global-names-in-headers,
|
|
26
|
-
google-readability-casting,
|
|
27
|
-
-bugprone-easily-swappable-parameters,
|
|
28
|
-
-cppcoreguidelines-avoid-magic-numbers,
|
|
29
|
-
-modernize-use-trailing-return-type,
|
|
30
|
-
-portability-avoid-pragma-once,
|
|
31
|
-
-readability-identifier-length,
|
|
32
|
-
-readability-magic-numbers
|
|
7
|
+
google-*,
|
|
8
|
+
readability-identifier-naming
|
|
33
9
|
|
|
34
10
|
WarningsAsErrors: '*'
|
|
35
11
|
# 头文件过滤由调用方按项目目录传入;这里不写 .*,避免把第三方头纳入。
|
|
@@ -37,7 +13,9 @@ FormatStyle: file
|
|
|
37
13
|
UseColor: true
|
|
38
14
|
|
|
39
15
|
CheckOptions:
|
|
40
|
-
#
|
|
16
|
+
# 命名按 Google:类型/函数 PascalCase,变量 snake_case,私有成员尾随 _,
|
|
17
|
+
# 常量 k 前缀。Google 允许访问器写成 count()/set_count(),因此不设
|
|
18
|
+
# FunctionCase,避免把 snake_case 访问器误报。
|
|
41
19
|
- key: readability-identifier-naming.NamespaceCase
|
|
42
20
|
value: lower_case
|
|
43
21
|
- key: readability-identifier-naming.ClassCase
|
|
@@ -50,8 +28,6 @@ CheckOptions:
|
|
|
50
28
|
value: CamelCase
|
|
51
29
|
- key: readability-identifier-naming.EnumConstantPrefix
|
|
52
30
|
value: 'k'
|
|
53
|
-
- key: readability-identifier-naming.FunctionCase
|
|
54
|
-
value: CamelCase
|
|
55
31
|
- key: readability-identifier-naming.TypeAliasCase
|
|
56
32
|
value: CamelCase
|
|
57
33
|
- key: readability-identifier-naming.TypedefCase
|
|
@@ -62,6 +38,7 @@ CheckOptions:
|
|
|
62
38
|
value: lower_case
|
|
63
39
|
- key: readability-identifier-naming.ParameterCase
|
|
64
40
|
value: lower_case
|
|
41
|
+
# 结构体成员不加尾随下划线;只有类的私有成员用 _ 后缀。
|
|
65
42
|
- key: readability-identifier-naming.FieldCase
|
|
66
43
|
value: lower_case
|
|
67
44
|
- key: readability-identifier-naming.PrivateMemberCase
|
|
@@ -82,11 +59,3 @@ CheckOptions:
|
|
|
82
59
|
value: 'k'
|
|
83
60
|
- key: readability-identifier-naming.MacroDefinitionCase
|
|
84
61
|
value: UPPER_CASE
|
|
85
|
-
# 函数长度:Google 建议短函数,超过 40 行提示。
|
|
86
|
-
- key: readability-function-size.LineThreshold
|
|
87
|
-
value: 40
|
|
88
|
-
- key: readability-function-size.StatementThreshold
|
|
89
|
-
value: 50
|
|
90
|
-
# 空容器/默认构造成员不加 {};与 NSDMI 规则配套。
|
|
91
|
-
- key: readability-redundant-member-init.IgnoreBaseInCopyConstructors
|
|
92
|
-
value: true
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 标准来自 build/clang/compile_commands.json,不要在这里写死 -std:
|
|
2
|
+
# 否则 C++23 工程会被降成 .clangd 里的旧标准。
|
|
2
3
|
CompileFlags:
|
|
3
4
|
CompilationDatabase: build/clang
|
|
4
|
-
Add:
|
|
5
|
-
- -std=c++20
|
|
6
|
-
- -Wall
|
|
7
|
-
- -Wextra
|
|
8
5
|
Diagnostics:
|
|
9
6
|
# 静态检查规则只在 .clang-tidy 里维护;这里不复制检查列表。
|
|
10
7
|
Suppress:
|
|
@@ -6,10 +6,25 @@
|
|
|
6
6
|
"--header-insertion=never",
|
|
7
7
|
"--background-index"
|
|
8
8
|
],
|
|
9
|
+
// VSCode 的配置、构建、运行和调试入口都留在 CMake Tools。
|
|
10
|
+
// 不另建 launch.json / tasks.json,避免出现第二套构建或启动路径。
|
|
9
11
|
"cmake.buildDirectory": "${workspaceFolder}/build/clang",
|
|
10
12
|
"cmake.generator": "Ninja",
|
|
11
13
|
"cmake.configureOnOpen": false,
|
|
12
|
-
|
|
14
|
+
"cmake.buildBeforeRun": true,
|
|
15
|
+
"cmake.exportCompileCommandsFile": true,
|
|
16
|
+
// CMake Tools 的快速调试默认使用 C/C++ 扩展的 cppdbg 适配器;
|
|
17
|
+
// 这里只把它的调试后端改成 LLDB。GCC 模式改成 gdb + /usr/bin/gdb。
|
|
18
|
+
"cmake.debugConfig": {
|
|
19
|
+
"type": "cppdbg",
|
|
20
|
+
"request": "launch",
|
|
21
|
+
"MIMode": "lldb",
|
|
22
|
+
"miDebuggerPath": "/usr/bin/lldb",
|
|
23
|
+
"stopAtEntry": false,
|
|
24
|
+
"externalConsole": false
|
|
25
|
+
},
|
|
26
|
+
// cpptools 只作为 CMake 的调试后端,不再提供 IntelliSense;
|
|
27
|
+
// 补全、跳转、诊断和格式化都由读取 compile_commands.json 的 clangd 负责。
|
|
13
28
|
"C_Cpp.intelliSenseEngine": "disabled",
|
|
14
29
|
"editor.formatOnSave": true,
|
|
15
30
|
"[cpp]": {
|