Repository navigation
mcpp-vscode 0.7.0: build.mcpp 是 C++ 文件,由 C++ Modules 编译;「其他 C++ 语言服务」一键关闭 - #18
Merged
Merged
Conversation
…一键关闭 build.mcpp 不再是独立语言 mcpp-build。VS Code 中文件名匹配优先于扩展名匹配, 0.6.0 的 mcpp-build 让 build.mcpp 绕开了按 cpp 选择文档的 C++ Modules:构建程序 只得到逐行文本检查,`import mcpp.rules.qt;` 之后的 `mcpp::rules::qt::…` 被误报为 unknown mcpp::rules。现在本扩展把 build.mcpp 声明为 cpp,删除 mcpp-build 的语言、 grammar 与 language configuration,build-script 能力注册在名为 build.mcpp 的 cpp 文档上,模块 grammar 只注入 source.cpp。 C++ Modules 在服务该文件时(已安装、已启用、mcppls.enable 不为 false), unknownSymbol 与 import 之后的模块补全、悬停交给它;SPEC-007 规则检查、mcpp:: 指令的补全悬停与代码片段保留。unknownSymbol 自身改为看文件的 import: `import mcpp.<X>…;` 带进来的 `mcpp::<X>` 不再报。 工程 → 基本信息 → 语言服务增加「其他 C++ 语言服务」一行:C/C++、clangd、ccls 在工作时显示警告与名称,点击执行 C++ Modules 自己的关闭命令(它询问作用范围); 没有时为暗色的通过图标;C++ Modules 记得改过的设置时,右键菜单提供恢复。数据来自 C++ Modules 0.0.16 的 otherCppFeatures(),旧版本退回本地只读检测。关闭与恢复拆成 两条能力,不再共用一条候选链。 另:mcpp 2026.10.11.1 把 [build] 的键移到 key registry,toml schema 生成器改从 那里读取;build-script 快照与 toml schema 随之按 2026.10.11.1 重新生成。
Sunrisepeak
added a commit
to Sunrisepeak/mcpp-language-server
that referenced
this pull request
Oct 13, 2026
…nput is no change, a module that failed in an import is named, build.mcpp beside the mcpp extension (#58) Typing (A4), idle (A1, A2), failed modules (A3) and build.mcpp beside mcpp-vscode (A6); plan .agents/docs/2026-10-14-cross-repo-build-mcpp-and-typing-cpu-plan.md. With mcpp-community/mcpp-vscode#18 and mcpp-community/mcpp-plugins#47.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为什么
0.6.0 把
build.mcpp声明为独立语言mcpp-build(filenames: ["build.mcpp"])。VS Code 中文件名匹配优先于扩展名匹配,于是build.mcpp绕开了按cpp选择文档的 C++ Modules(mcppls):import mcpp.rules.qt;之后的mcpp::rules::qt::…被误报为unknown mcpp::rules(每个 Qt 构建程序都有)。改了什么
B1
build.mcpp是cpp文档mcpp-build语言、source.mcpp-buildgrammar 与其 language configuration;改为给cpp声明filenames: ["build.mcpp"](不依赖 mcppls 也成立)。{ language: "cpp", pattern: "**/build.mcpp" }上;模块 grammar 只注入source.cpp。"[mcpp-build]": {…}的语言专属设置改写到"[cpp]"(CHANGELOG 已写明)。B2 C++ Modules 在时去重,不在时修正
mcppls.enable不为 false)时:unknownSymbol关闭,import之后的模块补全与悬停交给它;状态变化时立即重新检查已打开的文件。mcpp::指令补全与悬停、代码片段。unknownSymbol运行时看文件自己的 import:import mcpp.<X>…;带进来的mcpp::<X>不报。B3 「其他 C++ 语言服务」一行(工程 → 基本信息 → 语言服务)
warning图标 + 名称,点击执行mcppls.turnOffOtherCppFeatures(mcppls 自己询问作用范围,写的是对方扩展自己的设置,从不写mcppls.*)。pass图标,disabledForeground着色,「仅 C++ Modules 在提供 C++ 语言服务」,无点击。mcppls.restoreOtherCppFeatures。otherCppFeatures();旧版本或读取失败时退回本地只读检测(同三个候选),此时不提供恢复。danger: none。顺带修复 CI 的生成物漂移门
[build]的键移到key_registry.cppm(registry_keys("build")),generate-toml-schema.mjs找不到kKnownBuildKeys[]而失败;生成器改为在这种写法下读 registry。快照按 2026.10.11.1 重新生成。验证
npm test:681 通过(新增:import 感知的unknownSymbol、关闭unknownSymbol时规则检查仍在、otherCppFeatures的两种来源与畸形输入、视图三种状态、右键菜单的when、manifest 不再有mcpp-build)。build.mcpp以cpp打开、只有规则检查的诊断」。check:generated对 mcpp main 通过。