Repository navigation
feat(toolchain): 工具定义声明设置分组(toolDefinitions 1),新增 toolchains.settingsView 和三级设置导航 - #99
Merged
Merged
Conversation
…View 和三级设置导航 - toolDefinitions 1:工具定义可以声明 category(runtime/build/package/debug/lint/other) 和 audience(user/plugin)。旧宿主会拒绝这两个字段,所以用到时必须声明 requires.toolDefinitions 1;Core 声明支持 [0, 1]。 - toolchains.settingsView:Core 按状态、筛选、文字搜索、分组、排序和计数投影设置页的 工具列表,返回可见行、前 N 个待处理项和全局计数。宿主只渲染看得见的行,不自己分类 解析原因,也不重新排序或计数。插件自用运行时单独成组、默认折叠;按插件分组超过 40 组时 默认折叠。 - plugins.settings.navigation:导航最多三级;分组可以声明 limit,未搜索时只显示前 limit 个 子项,后面跟一行 overflow(全部 N 个);搜索时展开全部并返回 matched 和 path。父链断开、 成环或超过三级都拒绝。 - 契约 schema:requires.buildProviders 的枚举补上 1(Core 早已支持),toolDefinitions 加上 [0, 1];文档同步更新,更新记录加待合入条目。
xiaoyumuxi
marked this pull request as ready for review
November 18, 2026 13:04
15 of 17 tasks
This was referenced Nov 18, 2026
This was referenced Nov 18, 2026
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
类型
feat:新能力版本
toolDefinitions1,新增 Core 命令toolchains.settingsView,plugins.settings.navigation支持三级折叠。改动
插件契约(
shared/plugins/contract/v1/)requires.toolDefinitions: 1:categoryruntime、build、package、debug、lint、otherotheraudienceuser、pluginuserplugin表示插件自用的运行时(比如语言服务器需要的 JDK),单独成组、默认折叠plugin-manifest.schema.json:requires.toolDefinitions加上枚举[0, 1]。顺手补了requires.buildProviders的版本 1,feat(build-providers): buildProviders 1 按源文件找运行入口(当前文件运行) #89 在 Core 里已经支持,schema 一直没改。toolchains/README.md:定义字段表加两个字段;命令表加toolchains.settingsView;新增 “Settings list” 一节,写清输入、状态分类、行、折叠、待处理项和计数。原来没有标题的 fixture 段落补上标题 “Fixtures and acceptance vectors”。README.md能力表的toolDefinitions行写上版本 1。Core
lithe-plugin-model:TOOL_DEFINITIONS支持[0, 1]。模块注释原来写“只有版本 0”,已改正。lithe-plugin-manifest:validation.rs:定义里出现category或audience,但requires.toolDefinitions小于 1 时,拒绝在requires.toolDefinitions。settings_surfaces.rs:导航最多三级,见下文。lithe-toolchain:definitions.rs:注册时校验并透传category、audience。settings_view.rs,即toolchains.settingsView,见下文。lithe-core:协议和分发加toolchains.settingsView,走plugin_response,受 4 MiB 预算限制。toolchains.settingsView宿主传入每个已启用工具的事实:
id、displayName、pluginID、pluginName?、category?、audience?、解析器给出的reason?、pinned、changed、terms[](版本号、路径等可搜索文字)。另外传查询条件{text, filter, groupBy, collapsed[], expanded[]},以及可选的issueLimit。返回{rows, issues, counts}:reason是ok。projectCodeRequiresAction、ambiguousInstallation、probeFailed是warning,用户不用安装就能处理。其余原因都是error。分类规则只在 Core 里有一份,宿主不再自己判断。all、problems、pinned、changed。文字搜索覆盖名称、ID、插件和terms,不区分大小写。category(固定顺序,插件自用运行时单独放最后)、plugin、none。组内先列有问题的,再按名称排;名称相同时按 ID 排,保证顺序稳定。collapsed、expanded里的选择优先。只要有筛选或搜索,所有组都展开,保证匹配项不会藏在折叠的组里。rows只有组头(key、count、problems、collapsed,以及category、audience或pluginID+title)和工具行(index、status)。宿主按index取回自己的数据,只渲染看得见的行。issues是全部工具里排在最前的 N 个问题,默认 5 个,最多 50 个,用在分组页的“需要处理”框。counts(total、matched、problems、errors、warnings、pinned、changed)始终按全部工具统计,不受筛选影响。terms,ID 必须唯一。plugins.settings.navigation三级折叠parent。limit,范围 1–512。不在搜索时只显示前limit个子项,后面加一行overflow: N,宿主把它画成“全部 N 个…”。matched(这一行本身命中搜索)和path(祖先标题),用来在搜索结果里显示完整路径。搜索时展开全部,不受limit限制。宿主调用 Core 的命令(不是插件宿主方法)
toolchains.settingsView(Core 命令,新)plugins.settings.navigation:新字段limit,返回行新增matched、path、overflow没有新增或修改
lithe/host/*宿主方法和通知,所以 API 总表的宿主方法表和更新记录的“宿主方法(按 API 编号)”索引不加行。文档
rust/contracts/rust-core-api.md:命令表加toolchains.settingsView;改写plugins.settings.navigation一段,写清三级、limit、matched、path、overflow 行和拒绝条件。reference/protocol-changelog.md:加待合入条目,“能力版本”表加toolDefinitions1。reference/capabilities-and-versions.md:加toolDefinitions1,桌面端写“未声明”,宿主 PR 接入后再改。另外改掉“每个能力的值都是 0”的过时说法。reference/domains/toolchains.md:中英文各加“设置页里的分组”一节,命令表加settingsView,命令数改为十个。错误码
没有新错误码。所有拒绝都用已有的
plugin.manifest.invalid或命令的rejected,field分别是requires.toolDefinitions、tools、tools.id、query、issueLimit、parent、limit。验证
cargo fmt --checkcargo test -p lithe-plugin-manifest -p lithe-toolchain -p lithe-plugin-model -p lithe-corescripts/rust-core/verify-rust-core-comments.shnode scripts/rust-core/verify-platform-tests.mjsnode shared/plugins/scripts/verify-docs.mjs新测试:
settings_view.rs的 4 个单元测试:固定分组顺序和“问题优先”、筛选时展开全部组且计数仍按全部工具、用户折叠覆盖默认值和 40 组以上默认折叠、拒绝未知取值和重复 ID。tool_definitions_declare_settings_category_and_audience:版本门槛、注册透传、非法取值。settings_navigation_folds_a_third_level_behind_an_overflow_row:12 个三级子项折叠成 6 个加一行 overflow;搜索返回命中项和祖先,且不受limit限制。settings_navigation_rejects_a_fourth_level_cycles_and_empty_limits。toolchain_resolution的分发测试加了toolchains.settingsView。没有运行
sdk-e2e.mjs:本 PR 不改插件后端协议。现有 fixture 和 SDK e2e 清单都不用category、audience,不受版本门槛影响。