[Feature] 将 Go 侧插件清单贡献段投影与排序迁入 Rust Core,替换 pluginservice 与 installedPluginFacts 的重复解码

未关闭
#2,363 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
22/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
go, json, rust
领域
devtools

调研方向

Start by running rg -n 'InstalledSnapshot|describeManifest|installedPluginFacts' desktop/internal/pluginservice desktop/internal/workbench to see every Go consumer that decodes plugin.json itself, then read the existing manifest validation/model in Lithe-IDEA/Lithe-core-rust before designing the new read-only catalog DTOs. Check how desktop/internal/core binds Core types and where PINNED_CORE_REVISION is bumped, since contract version, schema and fixtures must move together. Done means the listed methods in builds.go, toolwindows.go, vcs.go, activation.go and workbench/plugins.go consume Core output and the Go-side projection/sort structs are removed. This spans two repositories and is design-heavy, so it is not a starter task.

由索引模型根据 Issue 内容生成。

描述

area:extensions enhancement P2 platform:cross-platform refactor review: high Rust Core
Problem to solve / 要解决的问题

desktop/internal/pluginservice 中的各贡献段消费者及工作台设置汇总仍直接在平台 Go 层 json.Unmarshal plugin.json 并执行字段投影、默认值填充、过滤与排序(涉及 Go 共用的 macOS/Windows 桌面端;核心契约在 Core)。具体位置(由 rg -n 'InstalledSnapshot|describeManifest|installedPluginFacts' desktop/internal/pluginservice desktop/internal/workbench 核实):

  • desktop/internal/pluginservice/builds.go: (snapshot InstalledSnapshot) BuildPlugins()
  • desktop/internal/pluginservice/debug.go: (snapshot InstalledSnapshot) DebugPlugins()
  • desktop/internal/pluginservice/generators.go: (snapshot InstalledSnapshot) GeneratorPlugins()
  • desktop/internal/pluginservice/languages.go: (s *Service) LoadLanguagesFromSnapshot(...)
  • desktop/internal/pluginservice/outputlinks.go: (snapshot InstalledSnapshot) OutputLinkSources()
  • desktop/internal/pluginservice/search_languages.go: (snapshot InstalledSnapshot) SearchLanguageSources()
  • desktop/internal/pluginservice/toolchains.go: (snapshot InstalledSnapshot) ToolchainPlugins()
  • desktop/internal/pluginservice/toolcommands.go: (snapshot InstalledSnapshot) ToolCommands()
  • desktop/internal/pluginservice/toolwindows.go: (snapshot InstalledSnapshot) ToolWindows()
  • desktop/internal/pluginservice/vcs.go: (snapshot InstalledSnapshot) VcsPlugins()
  • desktop/internal/pluginservice/activation.go: syncFunctionRelay / activateWorkspace
  • desktop/internal/workbench/plugins.go: installedPluginFacts / describeManifest

保留它的代价:

  • Go 平台层与 lithe-core 各自维护一套插件清单贡献字段结构与投影/排序逻辑,新增或调整清单字段时两端容易漂移;
  • 每个消费者各自反序列化同一份 manifest.json 字节并做结构验证/排序,违背“可共享的解析、校验、排序与投影逻辑归属 Rust Core”。
Proposed solution / 建议方案
  1. 在 Rust Core(Lithe-IDEA/Lithe-core-rust)复用已有清单校验与模型,提供统一的只读插件贡献/呈现目录查询接口,直接输出结构化的语言、工具窗口、命令、构建系统、VCS、调试器、工具链、输出链接、生成器与插件摘要 DTO。
  2. 桌面端 desktop/internal/core 增加类型化绑定后,让 pluginservice 上述方法和 workbench/plugins.go::installedPluginFacts 直接消费 Core 返回的结构化目录,移除 Go 侧重复 JSON 解码结构体与排序规则。
  3. 风险:需先补齐 Core 契约版本、schema/fixture 和桌面端 PINNED_CORE_REVISION 协同升级,因此按 #2058 第 4 项评估结论在独立任务分阶段推进。
Target platform / 目标平台

Cross-platform / 跨平台

Area / 模块

Extensions / 扩展

Priority / 优先级

P2 / 后续考虑:目前不着急,可安排到后续版本

Alternatives considered / 已考虑的替代方案

仅通过 pluginservice.InstalledSnapshot 在 Go 侧共享同一批版本选择和有界读盘结果(已在 #2058 / PR #2339 实现),可以消除重读 I/O 与读取期不一致,但未能消除 Go 侧对清单贡献段的重复结构体解码与投影。

Additional context / 补充信息

源自 Issue #2058 第 4 项“顺带评估清单的贡献段解析是否应由 Core 返回”的评估及 PR #2339 交付后遗留的架构跟进;现有 Core 尚无统一返回这些呈现目录的接口,故单独建单跟踪迁入 Core。

Checklist / 提交前检查
  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
主要语言
TypeScript
星标
1.8k
派生
151
平均合并
3 小时 48 分钟
30 天内合并 PR
571

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

1lck/Lithe-IDEA 的其他 Issue

查看 1lck/Lithe-IDEA 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。