mcpp projects: no root compile_commands.json by default; read mcpp's result record for fallback and refresh
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- cpp
调研方向
Read src/project/mcpp.cppm at McppProvider::describe and the referenced mcpp design sections §7 and §5.2. Trace how the fallback selects a compilation database and how build refresh is forwarded by the editor extension; check the CLion e2e coverage. Done means the result record pointer is preferred, the root database remains a compatibility fallback, and the proposed refresh and CLion behavior are covered.
由索引模型根据 Issue 内容生成。
描述
Context
The next mcpp release changes two things mcppls touches on mcpp projects (design: mcpp/.agents/docs/2026-10-26-control-contract-runtime-and-ide-ecosystem-design.md, §7 and §5.2):
- The project-root
compile_commands.jsonis no longer written by default. It becomes opt-in through[build] compile_commands = "<path>"inmcpp.toml(or a default in~/.mcpp/config.toml). An existing root copy is no longer updated, and mcpp prints a one-time note. The per-configuration database (target/<triple>/<fp>/compile_commands.json) stays. - mcpp writes a result record after every build (
target/<triple>/<fp>/result.json, kindmcpp.result), plus a project-level pointertarget/.last-result.jsonnaming the most recent configuration. The record carries the configuration's compile database path, the diagnostics, and the artifacts.
What this means for mcppls
- Fallback path.
McppProvider::describefalls back to a leftover rootcompile_commands.jsonwhen mcpp cannot be asked (src/project/mcpp.cppm:41). After the change, that file is usually absent. The fallback should read the database named bytarget/.last-result.jsonfirst, and the root file only when the pointer is missing (older mcpp). - Refresh after a build. Watching
target/.last-result.json(written by atomic rename) tells mcppls that a build finished, whoever ran it: a terminal, an agent's shell, or an IDE. Today the refresh is forwarded by the editor extension. - CLion. Without a root
compile_commands.json, CLion no longer loads an mcpp project as a Compilation Database workspace, soClionModelno longer treats it as CLion's and mcppls starts by default. No code change is expected; an e2e assertion would pin it.
Nothing breaks immediately: the primary path (mcpp emit build-database) is unchanged. This issue tracks adopting the result record when that mcpp release ships.
- 主要语言
- C++
- 星标
- 25
- 派生
- 2
- 平均合并
- 21 小时 5 分钟
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Sunrisepeak/mcpp-language-server 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
Sunrisepeak/mcpp-language-server#80 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
Sunrisepeak/mcpp-language-server#66 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 1/100
Sunrisepeak/mcpp-language-server#77 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 15/100
Sunrisepeak/mcpp-language-server#59 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 20/100
Sunrisepeak/mcpp-language-server#52 ·
维护者通常 1 天内回复
查看 Sunrisepeak/mcpp-language-server 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
xiaoyifang/goldendict-ng#3148 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 91/100
triton-inference-server/server#9069 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 4 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 78/100