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

Open
#2,363 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
22/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
go, json, rust
Domain
devtools

Research direction

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.

Written by the indexing model from the issue text.

Description

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,确认没有重复建议。
Dominant language
TypeScript
Stars
1.8k
Forks
151
Avg merge
3h 48m
Merged PRs (30d)
571

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 1lck/Lithe-IDEA

All issues in 1lck/Lithe-IDEA

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.