feat(windows): add unified Maven tool window - #321
Conversation
3397b8e to
78e76b0Compare
1lck
left a comment
There was a problem hiding this comment.
Windows 这半边整体跟得挺齐:React 只通过 @/platform/tauri-core 走,参数一律来自共享 Core,maven.store.ts 里 launchRevision/diagnosticsRevision 那套旧结果隔离做得比较细,进程按 operation ID 停。工作区作用域的 store 拆分也对。
主要三条,都跟「两端对不齐」有关——这也是两个 PR 分开 review 的代价,单看任一个都是自洽的。
另外 #320 上我提了三个 Run 路径的回归(cwd 被覆盖、skipTests 没法覆盖、-am 写死),其中 cwd 那条在这边是必然触发的:run.store.ts 无条件传 currentMavenLaunchContext(root),所以 Windows 上所有 Maven Run 配置的工作目录都会被 reactor 路径改掉。等 #320 修完 rebase 就好,这边不用单独动。
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
78e76b0 to
a1b6eb6Compare3ae29d7 to
f431371Comparea1b6eb6 to
d9429f4Compare1lck
commented
Aug 29, 2026
这个是草稿 在开发是吧 @Mucheen |
Mucheen
commented
Aug 30, 2026
via email
对,还没开发完 |
Wait for the workspace Maven load before planning Maven-backed Run configurations so project profiles, settings, skip-tests, and toolchain paths are applied consistently. Add a deterministic regression test for the pending-load race. Refs #291
Await active and pending editor saves before Maven goals or Run configurations create their launch plans. Surface actionable failures and cover save ordering, failures, and the in-flight auto-save race.
There was a problem hiding this comment.
Windows Maven 主体实现的分层方向是对的:React 通过 @/platform/tauri-core,Launch Plan 由共享 Core 生成,Maven store 也覆盖了旧结果隔离、取消竞态和配置写入串行化。现有 Windows CI、相关 Bun 测试和 Rust 测试均通过。
不过当前还有两处会破坏多项目 workspace 隔离的行为问题,因此这轮先 Request changes:
- Java LSP 解析 Maven context 时丢失来源 workspace ID,后台预热/重启可能把 A 项目写进当前激活的 B store,并停止 B 的 Maven 任务。
- Maven Reload 在 await 后重新读取当前激活 store,会把旧 root 和新 workspace 的文件/store 混用。
推荐不要继续依赖 workspaceRuntimeRegistry.getActiveWorkspaceId() 作为异步流程的隐式上下文。可以引入一个轻量的 WorkspaceLaunchScope(workspaceId + root),从 workspace 初始化、LSP owner、LSP client 一直传到 Maven context resolver;所有 await 后的读写都使用 getStore(scope.workspaceId),并在执行 UI 或 LSP 副作用前校验 scope 仍有效。这样 Run、Maven 和 JDT LS 三条路径会共享同一种 workspace 所有权模型。
建议补两组确定性回归测试:
- 激活 B 时为 A resolve/restart Java LSP,断言只更新 A 的 Maven store,B 的 project、activeSessionId 和输出保持不变。
- A 点击 Reload 后挂起 scan,切到 B 再完成 scan,断言不会读取或修改 B 的 Maven/FileSystem store,也不会用 B 的 Java 文件 prewarm A。
另外活动栏的可见性菜单和 workbench.maven 中英文文案还没有接完整,详见 inline comments。前两项修复并补测试后,这个 PR 的整体质量就比较稳了。
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Preserve explicit workspace ownership across Java LSP launch and Maven reload paths, and expose Maven in activity visibility and localization.
Uh oh!
There was an error while loading. Please reload this page.
依赖关系
Depends on #320. 本 PR 的 base 已设置为
feat/issue-291-macos-maven,且相对 #320 只包含windows/。合并顺序为 #320 -> #321;#320 合并后再把本分支 rebase 到最新preview。Closes#291 after #320 is merged.
主要变更
settings.xml、Maven executable 和 Maven JDK 与 Run/JDT LS 共用 feat(maven): unify shared Maven context and macOS tool window #320 的 Maven 上下文。@/platform/tauri-core与 host 通信;Maven 参数全部由共享 Core Launch Plan 生成。Review 修复
MavenTaskStatus增加cancelled;停止成功和“退出事件先于 stop 返回”的竞态都会保留取消状态及输出,清空输出后恢复idle。false不会被null吞掉。run.store.ts中与 Maven 无关的 import、缩进和换行变化。测试覆盖
mavenSkipTests三态 tests。已执行验证
tsc --noEmit通过。./scripts/verify-shared-contracts.sh./scripts/verify-windows-boundaries.sh./.agents/skills/write-stable-tests/scripts/verify-test-stability.shgit diff --check通过。尚未执行
本机没有 Parallels CLI 和 Bun,无法执行真实 Windows guest 的 timing lane 或 UI 手工验收。当前 Windows CI 会执行 Bun、Tauri Rust 和构建验证,本 PR 保持 Draft,待 CI 结果确认后再转 Ready。