Skip to content

feat(core): #1662 车道 D LSP/编辑器下沉(LSP-03/04/08/09/13~17) - #1756

Merged
1lck merged 7 commits into
previewfrom
feat/issue-1662-d-lsp-editor
Nov 5, 2026
Merged

1lck merged 7 commits into
previewfrom
feat/issue-1662-d-lsp-editor

Conversation

@1lck

@1lck 1lck commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

引用 #1662(车道 D:LSP/编辑器)。本 PR 把车道 D 的规则下沉到 Rust Core,共享 fixture 锁定行为;有两端调用方的条目都已删除旧平台实现,没有调用方的 Core 命令不在本 PR 内。不做 LSP-12。

条目与状态

条目 Core 命令 macOS Windows
LSP-03 workspace edit 目标校验与提交顺序 lsp.planWorkspaceEdit 已接入,删除本地边界检查 已接入:工作区边界、只读检查走 Core;补上版本检查和写盘失败回滚,带保护的写入仍在平台
LSP-04 跳转目标分类 lsp.classifyNavigationTarget 已接入,删除本地路径前缀/语言判断 已接入:外部同语言源码只读打开,被拒绝目标不读取
LSP-08 自动启动策略 lsp.activationPolicy 已接入 已接入,删除 language-server-failure-cooldown
LSP-09 补全合并(core 不含关键词表) lsp.mergeCompletions 已接入 无旧实现可删:Windows 只有单一 LSP 补全来源,没有 TS 合并/去重;已写入功能矩阵 lsp-completion-hover
LSP-13 插件文本编辑批次 editor.planTextEdits(复用 lsp.applyTextEdits 规则) 已接入,删除 Swift 私有规划器 无旧实现可删:Windows 尚无文档编辑插件 API,接入时复用同一命令;已写入 plugin-host-editor-file-window-services
LSP-14 批量保存 plan/reduce document.planSaveBatch / document.reduceSaveBatch 已接入;不再在第一个失败处停止 已接入:Save All 由 Core 选成员并归并结果,并发写入仍在平台
LSP-15 导航历史 reducer editor.navigationHistory.reduce 已接入 已接入
LSP-16 标签/分组 reducer 已撤出本 PR 已撤出 已撤出
LSP-17 Problems 查询 lsp.problems.query 已接入 已接入

LSP-16 撤出原因:Windows 的 pane-tree.ts 是同步树结构,数据模型与 Core 的 WorkbenchState 不同,接入要重构,且会把同步操作变成 IPC。Core 命令、契约、fixture 和 macOS 接入都已撤掉,留待后续 PR。

行为变化

  • LSP-14:macOS 批量保存现在尝试所有成员,不再在第一个失败处停止;Windows 与 macOS 共用成员选择和结果规则。
  • LSP-04:Windows 现在会拒绝工作区外的非同语言文件,并以只读打开工作区外的同语言源码。
  • LSP-03:Windows 的 workspace edit 现在有工作区边界、只读文档拒绝,以及写盘失败后的回滚。
  • 高频路径(按键、编辑、滚动)不走 IPC。
  • 新增 i18n 词条:editor.workspaceEditOutsideWorkspace、editor.workspaceEditReadOnlyDocument、editor.workspaceEditRollbackFailed、native.languageEditCouldNotBePlanned。

新增 API

lsp.planWorkspaceEdit、lsp.classifyNavigationTarget、lsp.activationPolicy、lsp.mergeCompletions、lsp.problems.query、editor.planTextEdits、editor.navigationHistory.reduce、document.planSaveBatch、document.reduceSaveBatch;契约见 shared/contracts/rust-core-api.md。

验证

通过:

  • cargo test -p lithe-core --lib:1978 passed, 0 failed(rebase 到最新 preview 后)
  • macOS:test-macos.sh --filter 覆盖 EditorTextEditPlanner、LanguageNavigation、LanguageWorkspaceEdit、DocumentSave、NavigationHistory、ProblemsPanel、LanguageFeatureProvider、LanguageIntelligenceModule、EditorDocumentService:115 tests passed
  • verify-rust-core-comments.sh、verify-shared-contracts.sh、verify-platform-feature-matrix.sh、verify-windows-boundaries.sh、verify-core.sh、generate-i18n.mjs --check、verify-app-language-localization.mjs、verify-no-host-language-specifics.mjs
  • Windows bun 测试逐文件:navigation-target、workspace-edit、workspace-edit-races、text-edit-core、editor-app.store(41)、run-prelaunch(25)、diagnostics、jump-list 等均通过

未通过或未执行:

  • verify-service-boundaries.sh 报 AppModel+CodeNavigation.swift 627 行超限;该文件与 preview 完全一致,本 PR 未改动,是已有问题。
  • cargo check --bin lithe-windows 在非 Windows 主机上只有既有的 std::os::windows 报错,无新增错误。
  • 未跑完整 macOS 测试套件,只跑了上述子集。

🤖 Generated with Claude Code

1lck and others added 7 commits November 5, 2026 01:39
新增 Core 命令并让平台改用 Core 结果,删除对应的平台本地实现:
- LSP-03 lsp.planWorkspaceEdit:workspace edit 目标校验与提交顺序
- LSP-04 lsp.classifyNavigationTarget:跳转目标工作区/外部只读/拒绝分类
- LSP-08 lsp.activationPolicy:语言服务器失败后的自动启动策略
- LSP-09 lsp.mergeCompletions:多 provider 补全候选合并(不含语言关键词表)
- LSP-13 editor.planTextEdits:插件文本编辑批次校验与排序,复用 lsp.applyTextEdits 行索引规则
- LSP-14 document.planSaveBatch / reduceSaveBatch:批量保存计划与结果归并
- LSP-15 editor.navigationHistory.reduce:导航历史 reducer
- LSP-16 editor.workbenchState.reduce:标签/分组 reducer
- LSP-17 lsp.problems.query:Problems 过滤、排序、分组与计数

附带共享 fixture、契约文档、平台功能矩阵和语言特定词基线更新。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows 的 pane-tree 是同步树结构,与 Core 的 WorkbenchState 数据模型不同,接入需要大重构,不适合本 PR。撤掉 editor.workbenchState.reduce 的命令、契约、fixture、测试和 macOS 接入。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macOS 删除本地路径前缀和语言判断;Windows 外部同语言源码只读打开,被拒绝的目标不读取。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
工作区边界、只读检查和提交顺序由 Core 决定;Windows 补上版本检查和失败回滚,带保护的写入仍在平台执行。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macOS 不再在第一个失败处停止;Windows 的 Save All 改由 Core 选择成员并归并结果。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1lck

1lck commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

本地验证(代替 GitHub macOS / Windows CI)

本 PR 与 #1760、#1755、#1753、#1759、#1756、#1758、#1757 一起,在本地集成分支 integration/issue-1662-round1 上按合并顺序集成后,按 ci-macos.yml / ci-windows.yml 的步骤在维护者的 Mac 和 Windows 机器上完整验证,未使用 GitHub 的 macOS / Windows runner。

macOS(本机,macOS 26.6 arm64)

Windows(lithe-dev,Windows Server)

  • 通过:依赖安装、verify-windows-boundaries.ps1、共享编辑器测试、PHP 插件构建与隔离验证、ci-windows.yml 中各组 bun 测试、dist 验证、Rust 测试(shared、shared-hosts、MCP stdio、agent-host、git-host、ide-host、project、terminal、windows)。
  • 发现并已修复的回归(均为测试替身未跟上新的 Core 契约,生产代码无回归):bun run typecheck 3 个 TS 错误与 3 个 agent 测试文件(feat(core): #1662 车道 F Agent/AI 下沉(AGT-03/04/07~09/11~13/18) #1757)、git-workspace-status-panel.test.tsx(feat(core): #1662 车道 A Git 流程下沉(GIT-24/25/28/29) #1753)。
  • lithe-windows memory::platform::tests::current_process_private_working_set_is_available 失败,干净 preview 基线同样失败,属于该 Windows Server 环境的既有问题。
  • 跳过:real-jdt(机器无 JDK 21/25 与 Maven)、需要 GPU 或交互桌面的 GUI 验证、GitHub 专属的缓存/上传/gate 步骤。

合并前每个 PR 已 rebase 到最新 preview,并重新执行编译、i18n、verify-core、verify-shared-contracts 等快速检查。

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

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant