Skip to content

feat(build): report the implicit value of unset path options and option descriptions - #120

Merged
1lck merged 2 commits into
mainfrom
feat/build-option-defaults-and-l10n
Nov 19, 2026
Merged

1lck merged 2 commits into
mainfrom
feat/build-option-defaults-and-l10n

Conversation

@1lck

@1lck 1lck commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

关联 Issue / Linked issue

PR 类型 / Type

  • feat

改动说明

IDEA 的 Maven 设置里,“用户设置文件”和“本地仓库”在没有覆盖时也会灰显 Maven 实际使用的路径,勾选“覆盖”后才能编辑(MavenGeneralPanel 中的 PathOverrider)。Lithe 的构建选项只能拿到用户值或清单默认值,看不到工具自己的取值,所以只能显示空白。Maven 的实际路径只有工具知道,模型加载时由插件报告。

模型报告路径选项的实际值(optionDefaults)

  • 模型的 optionDefaults 原先只能填 choicesFromModel 选项,现在也可以填 text、file、directory 选项,值是选项未设置时工具实际使用的那一个。只保留第一个值,因为工具只有一个。
  • 适用于 litheBuildModel 规范模型和静态模型的 model.map.optionDefaults。boolean 选项和声明了固定选项的选择类选项仍会被拒绝,错误信息也相应更新。
  • 这个值只用于显示,不生成任何参数,也不进入选项指纹,所以工具自己的配置变了以后仍由工具决定。

build.resolveOptions 返回值

  • 对未设置(source: "unset")的 text、file、directory 选项返回 implicitValue。用户设了值或清单声明了 default 时不返回,因为那时生效值就是 value。
  • 返回清单中的 description。

清单

  • options[].description(1–512 个字符):选项的作用说明,供宿主在选项旁的 ⓘ 中显示,只用于显示。

契约与文档

  • plugin-manifest.schema.json:options[].description,以及 optionDefaults 的说明。
  • 契约 README:选项表、build.resolveOptions 的返回值和 litheBuildModel 一节。
  • reference/domains/build-systems.md 中英文同步。
  • 插件协议更新记录:2026-11-19 新增一行(API-29)。

验证

  • cargo test -p lithe-build -p lithe-core 在 macOS ARM64 上通过。新增两个测试:
    • model_reports_the_implicit_value_of_unset_path_options:规范模型只保留第一个值,boolean 选项的值被丢弃;未设置时返回 implicitValue 和 description;有声明默认值或用户值时不返回。
    • model_map_option_defaults_name_choice_or_text_options:静态映射可以填 file 选项,填 boolean 选项会被拒绝。
  • cargo clippy -D warnings、cargo fmt --check、verify-rust-core-comments.sh build、node shared/plugins/scripts/verify-docs.mjs 都通过。
  • 插件后端协议没有改动,不需要运行 sdk-e2e.mjs;旧插件不受影响。

🤖 Generated with Claude Code

1lck and others added 2 commits November 19, 2026 04:27
…on descriptions

A model's optionDefaults may now name a text, file or directory option: the
value the tool uses while the option is unset (Maven's user settings file and
local repository). build.resolveOptions returns it as implicitValue, display
only, so hosts can show the effective path as IDEA's PathOverrider does.
Options may declare a description for the host's info icon.

Refs 1lck/Lithe-IDEA#2152, 1lck/Lithe-IDEA#2204

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant