feat: add member-scoped mcpp run/test editor actions - #2
Merged
Conversation
Contributor
Author
Member
|
维护者结论:这个功能属于便捷入口,不是 mcpp 插件的必需核心能力;现有状态栏快捷菜单和命令面板已经能够执行 run/test。 不能只用 本次合并采用的边界是复用现有项目解析逻辑:以当前编辑资源为起点,解析其所在且属于当前 VS Code workspace 的最近 mcpp 工程/member。多 member 工作区 A/B/C 中,编辑 A 的文件只对 A 执行工程级 因此,这个 PR 在限定为 member-aware 的工程级快捷入口后具备可行性;仍需接受其与其他 Code Runner 类扩展在标题栏上的视觉冲突,这是入口位置本身的生态权衡。 |
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.

Summary
mcpp runandmcpp testactions to the editor title bar.cwd.findFiles("**/mcpp.toml")flag.$(tools) mcpp: 快捷菜单so it is distinct from the module availability status item.0.2.5; the release tag must be created from mergedmain, not from the PR head.Command semantics
These are project/member-level commands. They invoke fixed
mcpp run/mcpp testarguments from the resolved member root. They do not treat the active.cppfile as an independently runnable/testable file; that would require target/test mapping and is a separate feature.The original
editorLangId == cppcondition was insufficient because it exposed generic actions for every C++ file. The currentmcpp.inProjectcontext is derived from the active resource and its nearest in-workspace mcpp project instead.Necessity and compatibility
This is a convenience entry point, not required core functionality: the status-bar quick menu and command palette already expose run/test. Editor-title play/test buttons can still coexist with and visually compete with Code Runner and similar extensions. The member-scoped condition limits incorrect exposure, but it does not eliminate that ecosystem-level title-bar conflict.
Test plan
npm test: 95 passednpm run package: generatedmcpp-vscode-0.2.5.vsix0.2.5dist/src/commands.jscontains$(tools) mcpp: 快捷菜单Release order
v0.2.5from the mergedmaincommit..github/workflows/release.ymlrun tests/package and create or update the Release assets.