feat: add member-scoped mcpp run/test editor actions by Ximiaw · Pull Request #2 · mcpp-community/mcpp-vscode · GitHub
Skip to content

feat: add member-scoped mcpp run/test editor actions - #2

Merged
wellwei merged 4 commits into
mcpp-community:mainfrom
Ximiaw:feat/editor-title-run-test
Aug 6, 2026
Merged

feat: add member-scoped mcpp run/test editor actions#2
wellwei merged 4 commits into
mcpp-community:mainfrom
Ximiaw:feat/editor-title-run-test

Conversation

@Ximiaw

@Ximiaw Ximiaw commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Add mcpp run and mcpp test actions to the editor title bar.
  • Scope both visibility and execution to the mcpp project/member containing the active editor file. In a workspace with members A/B/C, editing A runs/tests A with A as the task cwd.
  • Hide the actions for files opened outside the current VS Code workspace, non-file editors, and resources without an mcpp project.
  • Reuse the existing project resolver and manifest watcher instead of maintaining a workspace-wide findFiles("**/mcpp.toml") flag.
  • Rename the existing status-bar shortcut to $(tools) mcpp: 快捷菜单 so it is distinct from the module availability status item.
  • Prepare extension version 0.2.5; the release tag must be created from merged main, not from the PR head.

Command semantics

These are project/member-level commands. They invoke fixed mcpp run / mcpp test arguments from the resolved member root. They do not treat the active .cpp file as an independently runnable/testable file; that would require target/test mapping and is a separate feature.

The original editorLangId == cpp condition was insufficient because it exposed generic actions for every C++ file. The current mcpp.inProject context 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 passed
  • npm run package: generated mcpp-vscode-0.2.5.vsix
  • Verified the packaged VSIX manifest reports version 0.2.5
  • Verified packaged dist/src/commands.js contains $(tools) mcpp: 快捷菜单
  • Regression coverage includes multi-member selection, workspace boundaries, context refresh, and status-bar naming

Release order

  1. Review and merge this PR.
  2. Create annotated tag v0.2.5 from the merged main commit.
  3. Let .github/workflows/release.yml run tests/package and create or update the Release assets.

@Ximiaw

Ximiaw commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

@wellwei wellwei changed the title feat: add run/test buttons to editor title bar feat: add member-scoped mcpp run/test editor actions Aug 6, 2026
@wellwei
wellwei merged commit 1a8ae33 into mcpp-community:main Aug 6, 2026
@wellwei

wellwei commented Aug 6, 2026

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants