Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
284 changes: 284 additions & 0 deletions .agents/docs/2026-10-20-module-graph-interaction-performance-design.md

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions .agents/docs/2026-10-20-module-graph-validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Modules graph 0.9.0 validation and review

Status: implementation and local review complete. The repository suite passes 725 tests; Chromium passes 11 interaction/export groups. Exact-head CI and released-artifact verification are final release gates.

## Review perspectives

| Perspective | Findings addressed | Evidence |
| --- | --- | --- |
| Graph semantics | Test-root budget starvation; parent traversal bringing sibling dependencies; edge limits stranding nodes; library classification based on target spelling | Graph/model and module provider regressions; large-project projection |
| Interaction | Click opening files; repeated expansion doing nothing; selected/focus/camera ambiguity; initial root centering overriding Fit; test paging lingering after entry focus | Chromium canvas tests; real VS Code fixture navigation; host regression for leaving the pager and restoring its page with Back |
| Refresh and concurrency | Event bursts starting duplicate reads; lock changes querying Modules; hidden refreshes; old view publications arriving after a project switch | Refresh coordinator tests and the real host module under a controlled message transport |
| Project state | Empty declarations removing the row; incomplete manifests clearing usable dependencies; delayed project switching exposing old actions | Dependency state tests; immediate cross-project update; real VS Code empty → ready → stale → ready checks with the installed VSIX |
| Cache correctness | Identical SVGs in different projects retaining old node identities | Chromium test proves layout reuse with new event bindings |
| Export | Theme variables missing offline; transformed/cropped drawing; excessive raster size | Light/dark standalone SVG and PNG, decoded dimensions, Unicode and marker inspection |
| Compatibility | Shared Packages canvas, read-only source documents, old language service commands | Existing unit and five service-variant Extension Host suites; real source read-only checks |
| Release and privacy | Local paths in the initial design; accidental Marketplace publication; packaged local evidence | Sanitized design, manual Marketplace workflow, archive inclusion/size gates |

## Local measurements

The mcpp baseline snapshot contains 343 retained nodes and 1,648 imports. Its roots include 149 test files. The old initial projection has 150 nodes and zero edges. The new Main projection has 51 nodes and 80 edges; complete source data remains available behind focus and paging.

Twenty fresh layouts using shipped Mermaid in Chromium measured median 163 ms and p95 171 ms for that real projection. These measurements include smaller budgets and removal of repeated import labels; they do not claim an equally sized layout algorithm became faster. Wide, shared and many-test synthetic samples also stay within the initial layout target.

The simplified toolbar combines formats and Mermaid copy under Export, moves depth controls into View options, and exposes node operations through the node context menu. Chromium checks cover right-click targeting, Shift+F10, arrow navigation, dismissal and focus restoration, plus control alignment and distinct theme colors.

A local native watcher resource exhaustion reproduced missing file events. The sidebar now supplements watchers and editor saves with two metadata stamps every two seconds while visible. Unchanged stamps cause no CLI query or layout. A real subprocess cancellation check also verifies that aborting a provider read terminates the child process.

Cold CLI queries still depend on mcppls indexing. No fan-speed or whole-editor power claim is made. Incomplete snapshots remain explicit; unchanged partial results stop automatic retrying.

## Required final gates

- Full repository consistency/unit suite and the new Chromium job.
- Existing Linux/macOS/Windows Extension Host and isolated VSIX install jobs, package guards and upstream drift check.
- Real VS Code large-project entry/test paging and selected-node focus: passed locally with the installed VSIX; repeat on the released artifact.
- Squash merge followed by successful tag release, GitHub/Open VSX artifact verification and local validation of the exact released VSIX.

Local screenshots and raw fixtures remain ignored development artifacts. Public evidence uses fixture names and aggregate statistics, without machine paths or editor profile data.
3 changes: 2 additions & 1 deletion .agents/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
| [`architecture.md`](architecture.md) | mcpp-vscode 的分层结构、模块职责与扩展点 | 现状 |
| [`mcpp-integration.md`](mcpp-integration.md) | 与 `mcpp-community/mcpp`(mcpp CLI)的接口契约 | 现状 |
| [`mcppls-integration.md`](mcppls-integration.md) | 与 `sunrisepeak.mcpp-language-server`(mcppls)的依赖与命令桥接契约 | 现状 |

| [`2026-10-20-module-graph-interaction-performance-design.md`](2026-10-20-module-graph-interaction-performance-design.md) | Modules 根分组、选择/焦点、局部展开、性能、Dependencies 状态与刷新、SVG/PNG 导出 | 0.9.0 实施中 |
| [`2026-10-20-module-graph-validation.md`](2026-10-20-module-graph-validation.md) | 0.9.0 多视角 review、性能与发布验收记录 | 验证中 |

边界:

Expand Down
6 changes: 5 additions & 1 deletion .agents/docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ extension.ts VS Code 装配层:激活、命令注册、provide

## 8. Shared dependency canvas and C++ Modules graph

- `graphs/model.ts` defines a provider-independent graph, component roots, depth/branch projection, 150-node/300-edge layout budgets and escaped Mermaid output. Complete module data is retained independently of the visible subgraph.
- `graphs/model.ts` defines a provider-independent graph, component roots, depth/branch projection, 60-node/80-edge default layout budgets (150/300 model ceiling), importer/dependency traversal, virtual entry groups and escaped Mermaid output. Complete module data is retained independently of the visible subgraph.
- `projects/dependencyGraphPanel.ts` owns one persistent Webview with separate per-project/per-kind graph and navigation states. `graphs/panelHtml.ts` and `media/graph.js` share rendering, wheel/pointer navigation, folding, focus, search and theme handling. Layouts are serialized; obsolete provider requests are discarded.
- `cli/moduleGraph.ts` is a trust-gated, time/output-bounded consumer of mcppls CLI JSON. This extends the integration boundary with structured queries, without taking over C++ parsing, resolution, LSP ownership or mcppls settings. Prefer the installed dependency extension's payload, with PATH fallback when absent.
- `projects/moduleGraph.ts` validates the result, reads manifest entry conventions and determines file ownership by the nearest project manifest. Preserve all internal edges and just the first hop into another package; `external=false` alone cannot identify project ownership. Generated sources outside the project boundary are conservatively treated as external.
- `webview/readOnlyDocuments.ts` is the shared content-addressed virtual-document store used by examples and graph navigation; graph messages contain node identities, and the host opens only provider files attached to those identities.
- Basics contains C++ Modules Deps; declared package Dependencies follow as a collapsed sibling before Common commands. Existing language-server module-graph forwarding commands remain compatible.

- `graphs/refresh.ts` coalesces events with a bounded debounce, serializes cancellable reads and defers hidden work. File and task events invalidate provider snapshots; content signatures suppress redundant layouts. Partial CLI snapshots retry only while changing and within a finite budget.
- `graphs/export.ts` bounds and validates SVG/PNG bytes before the host saves them. The browser inlines computed SVG styles and rasterizes the same drawing, independent of the camera.
- `projects/dependencyState.ts` rejects incomplete manifests and retains the last usable dependency rows on transient errors. Successful empty declarations produce an information row instead of removing the Dependencies position.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,22 @@ jobs:
VERSION=$(printf '%s\n' "$LIST" | sed -n 's/^sunrisepeak\.mcpp-language-server@//p')
echo "resolved mcppls $VERSION"
echo "resolved mcppls \`$VERSION\`" >> "$GITHUB_STEP_SUMMARY"

graph-browser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npx playwright install --with-deps chromium
- name: Render and interact with the shipped graph in Chromium
run: npm run test:graphs-ui
- uses: actions/upload-artifact@v4
if: always()
with:
name: graph-browser-evidence
path: .dev-profile/graph-ui-artifacts
if-no-files-found: warn
20 changes: 5 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ jobs:
--generate-notes
fi

# 两个市场收到的都是刚上传给 GitHub Release 的同一只 VSIX(SHA-256 对得上)。
# 分工是作者定的:Open VSX 是本流水线的必发目标——缺 token 显式失败,不静默跳过;
# Marketplace 机会发布——没配 token 就打一行说明跳过,Release 本身不因此失败。
# secret 名即仓库已配置的 OPENVSX_TOKEN;--pat 显式传入,不依赖 CLI 的环境变量约定。
# Open VSX receives the exact VSIX attached to the GitHub Release.
# Marketplace upload uses that same artifact through the publisher portal.
- name: 发布到 Open VSX
shell: bash
env:
Expand All @@ -102,14 +100,6 @@ jobs:
fi
npx ovsx publish "mcpp-vscode-${PACKAGE_VERSION}.vsix" --pat "$OPENVSX_TOKEN"

- name: 发布到 Visual Studio Marketplace(未配置 token 则跳过)
shell: bash
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
set -euo pipefail
if [ -z "${VSCE_PAT:-}" ]; then
echo "未配置 VSCE_PAT:跳过 Marketplace 发布(Open VSX 与 GitHub Release 不受影响)。"
exit 0
fi
npx vsce publish --packagePath "mcpp-vscode-${PACKAGE_VERSION}.vsix"
# The signed-off VSIX is uploaded manually to Visual Studio Marketplace.
- name: Marketplace upload artifact
run: echo "Upload the GitHub Release VSIX manually to Visual Studio Marketplace."
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
## Unreleased

## 0.9.0 - 2026-10-20

- Node operations use a keyboard-accessible right-click menu. Refresh/Export use theme colors, aligned chevrons and matching control heights; depth selectors align in View options.
- Visible project metadata checks recover Dependencies updates when native file events are dropped, without repeated CLI reads for unchanged files.

- Group module entries into Main, Library, Tests and Other, with paged test entries and a connected default view for large projects.
- Separate selection, focus and camera navigation: click to select, double-click to open source, locate either selection or focus, and explore two importer levels alongside three dependency levels. Local expansion advances repeatedly and preserves shared branches.
- Coalesce graph refresh events, cancel obsolete queries, reuse unchanged layouts and pause hidden graph work. Preserve dependency rows through transient manifest failures and show a status line when no declarations are available.
- Keep entry/search controls visible and group export formats, view settings and node actions into compact menus.
- Export the visible graph as offline SVG or bounded PNG without expanding or querying the full project. Add Chromium coverage for graph interaction, layout reuse and exports.
- Release VSIX remains available on GitHub and Open VSX; Visual Studio Marketplace upload is manual.

## 0.8.0 - 2026-10-19

- Package details use the available editor width on fullscreen displays, with bounded side gutters and a compact metadata column.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ its own and only **forwards** to it ([docs/architecture.md](docs/architecture.md
| [mcpp-language-server](https://github.com/Sunrisepeak/mcpp-language-server) | The C++ Modules language service; a hard dependency of this extension | [Marketplace](https://marketplace.visualstudio.com/items?itemName=sunrisepeak.mcpp-language-server) · [Open VSX](https://open-vsx.org/extension/sunrisepeak/mcpp-language-server) |
| mcpp-vscode (this extension) | The VS Code front end | [Marketplace](https://marketplace.visualstudio.com/items?itemName=mcpp-community.mcpp-vscode) · [Open VSX](https://open-vsx.org/extension/mcpp-community/mcpp-vscode) · [Releases](https://github.com/mcpp-community/mcpp-vscode/releases) |

See [dependency graph navigation and exports](docs/dependency-graphs.md) for entry groups, importer depth, refresh behavior and SVG/PNG export.

## Install

Any of the three channels installs the same extension:
Expand Down Expand Up @@ -73,8 +75,7 @@ that never touches your real one.

Release: bump the version in `package.json` and `package-lock.json`, commit, and push a tag
matching the version exactly. The workflow runs the tests, packages one VSIX, and publishes that
same artifact to GitHub Releases and Open VSX — and to the Marketplace when its token is
configured.
same artifact to GitHub Releases and Open VSX. Upload that VSIX manually through the Visual Studio Marketplace publisher portal.

## License

Expand Down
6 changes: 4 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ C++ 模块语义——诊断、补全、悬停、定义、引用、模块图—
| [mcpp-language-server](https://github.com/Sunrisepeak/mcpp-language-server) | C++ Modules 语言服务;本扩展的硬依赖 | [Marketplace](https://marketplace.visualstudio.com/items?itemName=sunrisepeak.mcpp-language-server) · [Open VSX](https://open-vsx.org/extension/sunrisepeak/mcpp-language-server) |
| mcpp-vscode(本扩展) | VS Code 前端 | [Marketplace](https://marketplace.visualstudio.com/items?itemName=mcpp-community.mcpp-vscode) · [Open VSX](https://open-vsx.org/extension/mcpp-community/mcpp-vscode) · [Releases](https://github.com/mcpp-community/mcpp-vscode/releases) |

模块入口分组、父节点深度、局部展开、刷新和 SVG/PNG 导出见 [依赖图使用说明](docs/dependency-graphs.md)。

## 安装

三个渠道装到的是同一个扩展:
Expand Down Expand Up @@ -71,8 +73,8 @@ C++ 模块语义——诊断、补全、悬停、定义、引用、模块图—
不会碰你自己的)。

发布:把 `package.json` 与 `package-lock.json` 的版本号改好并提交,推送与版本完全一致的
tag。工作流会跑测试、打包同一只 VSIX,并把它发到 GitHub Releases 与 Open VSX——Marketplace
在配置了 token 时同样自动发布。
tag。工作流会跑测试、打包同一只 VSIX,并发布到 GitHub Releases 与 Open VSX。官方 Marketplace
使用 Release 中的同一 VSIX 手动上传。

## 许可证

Expand Down
28 changes: 27 additions & 1 deletion data/i18n/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -588,5 +588,31 @@
"Packages show declarations; modules show mcppls imports. External modules stop after one hop.": "包图显示声明关系;模块图来自 mcppls,外部模块只显示一层。",
"Source is unavailable for this module.": "此模块的源码不可用。",
"Choose a module source file": "选择模块源码文件",
"The source graph is incomplete. Some modules may be omitted.": "源图数据不完整,部分模块可能尚未包含。"
"The source graph is incomplete. Some modules may be omitted.": "源图数据不完整,部分模块可能尚未包含。",
"Could not export this graph. Try SVG or a smaller view.": "无法导出此图,请尝试 SVG 或更小的视图。",
"Entry group": "入口分组",
"Selected": "选中",
"Export SVG": "导出 SVG",
"Export PNG": "导出 PNG",
"Dependencies depth": "依赖深度",
"Importers depth": "父节点深度",
"Previous entries": "上一批入口",
"Next entries": "下一批入口",
"Back": "后退",
"Locate focus": "定位焦点",
"Locate selected": "定位选中",
"Open source": "打开源码",
"Expand importers": "展开父节点",
"Collapse importers": "折叠父节点",
"Focus this result": "以此结果为焦点",
"Dependencies unavailable — click to retry": "暂时无法读取依赖,点击重试",
"Reading dependencies…": "正在读取依赖…",
"This project declares no dependencies": "此项目未声明依赖",
"Refresh pending": "等待刷新",
"Main": "主程序",
"Tests": "测试",
"Other": "其他",
"Export": "导出",
"View options": "视图",
"Node actions": "节点操作"
}
4 changes: 4 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ mismatch, an untranslated runtime string or a stale snapshot fails before any te

`docs/` is excluded from the VSIX by `.vscodeignore`, so these links work on GitHub and in the
repository but not inside an installed extension.

## Graph canvas

Graph providers retain data separately from bounded visible projections. Entry grouping, two-way traversal and local folds live in `src/graphs/model.ts`; file/build events use a cancellable refresh coordinator. The canvas caches layouts and keeps camera/selection updates independent. SVG/PNG exports use the committed visible drawing. See [Dependency graphs](dependency-graphs.md).
4 changes: 4 additions & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@ title.
`src/cli/controller.ts` and is shown only while a project is found.
- `mcpp.internal.refreshProjectView` is registered by the project view but is **not**
contributed, so it never appears in the palette.

## Project graph navigation

The project package/module graph canvas supports independent selection and focus, importer depth, entry groups and SVG/PNG export. See [Dependency graphs](dependency-graphs.md). Existing forwarded mcppls graph commands remain separate.
Loading
Loading