Repository navigation
feat(plugins): 同一语言只由一个已启用插件提供语言服务器 - #1910
Merged
Merged
Conversation
启用插件或确认安装后,其他已启用、且为同一语言声明语言服务器的插件会被自动 停用:Core(Lithe-core-rust#39)在 plugins.installed.lifecycle 里返回 displacePlugin,宿主记为停用、停掉它的语言服务器和后端,提示用户停用了谁、 为什么,并为已打开的共享语言文档启动新插件的服务器。 - pluginmanager 规划时为每个已安装版本读出清单 languageServers,Apply 返回 Outcome(Changed、Displaced),新增 Enable。 - pluginservice.StopDisplaced 停止被顶替插件的程序。 - 工作台 plugin_displace.go:读名称、摘除服务器、后台停止、提示和重启服务器。 - 新文案 desktop.marketplace.languageServerDisplaced(中英)。 - Core 固定修订升到 a320d16(#38、#39)。 - 功能矩阵与 Agent Note 同步。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 14, 2026
Agent Note 与功能矩阵的验收步骤改用新名称,记录 Store 收录状态(Lithe-store#62 已合并,#63 等本规则发布)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
轻量 Java 插件已改名为 Java Support Lite(ID 不变,Lithe-IDEA/lithe-plugin-java-navigation#9,预发布 v0.0.3),Store 已收录 0.0.3(Lithe-IDEA/Lithe-store#62 已合并)。Java Support 1.2.0 的收录 Lithe-IDEA/Lithe-store#63 保持 Draft,等本 PR 合入并有包含该规则的 preview 发布后再合。本 PR 的 Agent Note 与功能矩阵已同步新名称(6ee68933e)。 |
1lck
marked this pull request as ready for review
November 14, 2026 09:26
1 task done
22 of 25 tasks
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.
关联 Issue / Linked issue
a320d16)TestTerminalMenuSelectsAllAndCopies在 preview 上稳定失败)、[Bug] scripts/i18n/test-i18n.mjs 在 preview 上卡住不退出:测试仍引用已删除的 macos/、windows/tauri 路径 #1908(scripts/i18n/test-i18n.mjs卡住不退出)PR 类型 / Type
改动说明 / What changes
背景 / Why
Java Support(JDT LS)和 Java Navigation(轻量跳转)都为
java声明语言服务器。两个同时启用时,宿主的LanguageServerProvider静默取插件列表里第一个,另一个形同失效:Java Navigation 按 ID 排在前面,装上它 JDT 就不启动,补全和诊断消失,界面没有任何提示。现在规定同一语言只由一个已启用插件提供语言服务器,启用或安装其中一个,另一个自动停用并提示用户。改动 / Changes
desktop/internal/core/plugin_lifecycle.go:PluginInstalledVersion新增LanguageServers;新步骤PluginDisplacePlugin(带PluginID、LanguageIDs),解析时缺插件或语言视为协议错误。desktop/internal/pluginmanager/pluginmanager.go:languageServers[].languageID(最多 8 MiB,与安装器上限一致);读不到或解析失败按“不提供语言服务器”处理(log-exempt:启动服务器和注册语言的路径会报告同一次失败)。Apply返回Outcome{Changed, Displaced};执行displacePlugin时先把对方记为停用,与 Disable 先记录后停止的顺序一致。Enable(id)返回被顶替的插件;EnableInstalled改为返回Outcome;SetEnabled(id, true)改走Enable。pluginservice/lifecycle.go:新增StopDisplaced,停止被顶替插件的语言服务器和后端。workbench/plugin_displace.go,workbench/plugins.go的启用和确认安装两处接入:detachPluginServer摘除被顶替插件的服务器,再在后台停止它;desktop.marketplace.languageServerDisplaced。desktop.marketplace.languageServerDisplaced中英词条和生成结果。2c1fed18→a320d16,新增 Feat/windows/terminal sessions #38(日志事件目录生成器、update.delta.fallback_selected)和 fix(database): keep workspace data fresh after refresh #39。plugin-extension-management.json补验证动作、证据和说明,两端仍是partial/pending。.agents/notes/implemented/architecture/2026-11-14-one-enabled-plugin-per-language-server.md,在plugin_displace.go加反向引用。pluginmanager_test.go新增 4 个、调整 1 个;新增workbench/plugin_displace_test.go。不在本 PR 范围内 / Out of scope
类型专属:feat
多平台对齐
规则在 Core,宿主是 macOS 与 Windows 共用的 Viva Go 代码,没有平台分支。
范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/plugin-extension-management.json:两端的实现状态和验证状态、证据路径、owner、验证动作都如实填写;没有运行验证的保持pending./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh;改了平台实现路径的,还运行了./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD.artifacts/下生成的矩阵视图统一日志系统 / Structured logging
operationFailedEvent(字段plugin_displace、plugin_list);用户操作和 Core 请求由现有执行轨迹记录path、错误用error类型,动态通道段来自已校验的 IDgenerate-log-events.mjs --check、verify-log-usage.mjs:Viva 迁移后这两个脚本已移除(见develop-lithe日志参考页、[Feature] 恢复 Viva 日志事件类型生成和目录使用门禁 #1802),未能运行界面文案 / i18n
shared/i18n/补齐中英词条,运行node scripts/i18n/generate-i18n.mjs并提交生成结果,没有手改生成文件;macOS 视图外使用L10n.stringnode scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或扩大豁免名单逻辑归属 / Logic placement
plugins.installed.lifecycle(fix(database): keep workspace data fresh after refresh #39)。宿主只读清单字段、执行步骤、呈现提示languageServers通用判断,没有 Java 或插件 ID 特判性能与内存 / Performance and memory
设置 / Settings
N/A:没有新增或修改设置项
插件契约 / Plugin contract
scripts/desktop/build-desktop-core.sh的PINNED_CORE_REVISION已升到a320d16sdk-e2e.mjs:没有改插件后端协议;Core PR 的 “SDK end-to-end with Rust Core” 检查已通过发行包与资源 / Bundle and resources
无用代码与重构 / Dead code and refactoring
SetEnabled的 enable 分支改走Enable,没有残留)验证 / Verification
cargo test -p lithe-core --lib shared_plugin_lifecycle_fixture(新增 8 个、非法请求 2 个用例;撤掉实现后失败)scripts/desktop/desktop-go.sh vet受影响 4 个包scripts/desktop/desktop-go.sh test ./internal/pluginmanager/ ./internal/core/scripts/desktop/desktop-go.sh test ./internal/workbench -run 'TestInstallingAPluginTurnsOffTheOneServingTheSameLanguage|TestConfirmedInstallIsEnabled'(去掉stopDisplaced调用后新测试失败:notice = "")scripts/desktop/desktop-go.sh test ./...(链接a320d16内容的 Core)TestTerminalMenuSelectsAllAndCopies失败。preview 基线在旧固定版本2c1fed18和新 Core 下同样失败,与本 PR 无关,已建 #1907node scripts/i18n/generate-i18n.mjs --check、verify-app-language-localization.mjsnode --test scripts/i18n/test-i18n.mjs./scripts/agent-notes/verify-agent-notes.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/preview HEAD./.agents/skills/write-stable-tests/scripts/verify-test-stability.sh未能执行的检查和原因:
test-i18n.mjs:见 [Bug] scripts/i18n/test-i18n.mjs 在 preview 上卡住不退出:测试仍引用已删除的 macos/、windows/tauri 路径 #1908。提交前确认 / Final checks
preview创建;目标分支:feat、fix、docs 为preview,release 以发布流程要求为准.build/、target/、dist/、.artifacts/等产物,没有凭据、个人路径和未脱敏的日志或截图🤖 Generated with Claude Code