From 26a83538ce02d7ef7a24cc443f5c82d1fad01f89 Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Fri, 20 Nov 2026 23:18:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(toolchain):=20=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E7=9A=84=E5=A4=9A=E5=85=A5=E5=8F=A3=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E4=BF=9D=E7=95=99=E5=B8=83=E5=B1=80=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rustup 把 ~/.cargo/bin/cargo、rust-analyzer 链接到自身,按启动时的名字决定运行哪个工具。 Core 校验外部安装后返回规范路径,把 cargo 解析成 rustup,版本探针运行的是 rustup, cargo 因此永远找不到。 布局文件链接到另一个文件名时,返回规范主目录下的布局路径;链接目标的类型、可执行位和 不越出主目录、不进入工作区的检查不变。同名链接(版本管理器别名等)仍返回规范路径。 顺带把已合入的 #112、#127、#128、#130、#133 从协议更新记录的“待合入”移到时间线。 --- .../core/src/tests/toolchain_resolution.rs | 37 +++++++++++++++++++ rust/crates/toolchain/src/paths.rs | 7 ++++ rust/crates/toolchain/src/query.rs | 34 ++++++++++++++++- .../plugins/contract/v1/toolchains/README.md | 6 ++- .../plugins/reference/domains/toolchains.md | 4 ++ .../plugins/reference/protocol-changelog.md | 30 +++++++-------- 6 files changed, 101 insertions(+), 17 deletions(-) diff --git a/rust/crates/core/src/tests/toolchain_resolution.rs b/rust/crates/core/src/tests/toolchain_resolution.rs index 297bb465..9d70873f 100644 --- a/rust/crates/core/src/tests/toolchain_resolution.rs +++ b/rust/crates/core/src/tests/toolchain_resolution.rs @@ -849,6 +849,43 @@ fn toolchain_resolution_accepts_a_provider_home_reached_through_an_alias_link() ); } +/// A multi-call program picks its tool from the name it starts with: rustup links `cargo` +/// to itself and runs cargo, but started as `rustup` it runs rustup. The selection keeps +/// the layout's file name beneath the canonical home instead of the link target. +#[test] +fn toolchain_resolution_starts_a_multi_call_link_by_its_layout_name() { + let mut value = input(); + installation(&mut value, HOME, "21.0.4"); + let link = format!("{HOME}/bin/java"); + let target = format!("{HOME}/bin/multiplexer"); + let facts = value["filesystem"].as_array_mut().unwrap(); + facts.retain(|fact| fact["path"] != link.as_str()); + facts.push(json!({"path":link,"canonicalPath":target,"kind":"file","executable":true})); + value["fixed"] = json!({"home":HOME}); + let mut unprobed = value.clone(); + unprobed["probes"] = json!([]); + let candidates = + candidates_command(value_for_candidates(&unprobed), validated_manifest_json).unwrap(); + assert!( + candidates["candidates"]["skipped"] + .as_array() + .unwrap() + .iter() + .any(|row| row["reason"] == "probeFailed" && row["executable"] == link.as_str()), + "{candidates}" + ); + // Started by its target's name the program answers as itself. + value["probes"] + .as_array_mut() + .unwrap() + .push(json!({"executable":target,"output":"multiplexer 1.28.2","exitCode":0})); + let result = resolve(&value); + let selected = &result["outcome"]["selection"]; + assert_eq!(selected["home"], HOME, "{result}"); + assert_eq!(selected["executable"], link.as_str()); + assert_eq!(selected["version"], "21.0.4"); +} + #[test] fn toolchain_resolution_definition_plugin_can_be_its_own_installation_provider() { let mut value = input(); diff --git a/rust/crates/toolchain/src/paths.rs b/rust/crates/toolchain/src/paths.rs index c6769e03..105d21c6 100644 --- a/rust/crates/toolchain/src/paths.rs +++ b/rust/crates/toolchain/src/paths.rs @@ -83,6 +83,13 @@ pub fn within(path: &str, root: &str, platform: &str, case_sensitive: bool) -> b path == root || path.starts_with(&format!("{}/", root.trim_end_matches('/'))) } +/// The last component of a native path, split with the target platform's separators. +pub fn file_name<'a>(path: &'a str, platform: &str) -> &'a str { + path.rsplit(|character| is_separator(character, rules(platform))) + .next() + .unwrap_or(path) +} + /// Joins a package-independent relative executable layout beneath a native home. pub fn join(home: &str, relative: &str, platform: &str) -> Option { if relative.is_empty() diff --git a/rust/crates/toolchain/src/query.rs b/rust/crates/toolchain/src/query.rs index 69514654..378f3291 100644 --- a/rust/crates/toolchain/src/query.rs +++ b/rust/crates/toolchain/src/query.rs @@ -542,6 +542,7 @@ fn checked_installation( "The executable escapes its installation or enters the workspace.", )); } + let executable = invoked_executable(&executable, &canonical_home, layout, facts)?; return Ok(json!({"home":canonical_home,"executable":executable})); } Err(reject( @@ -551,8 +552,39 @@ fn checked_installation( )) } +/// The path a checked installation's program starts from: its canonical target, +/// unless the layout's file links to a program with another file name. Such a +/// program may pick what to run from the name it was started with (rustup links +/// `cargo` and `rust-analyzer` to itself and runs the named tool; started as +/// `rustup` it runs rustup), so it starts from the layout path beneath the canonical +/// home. The canonical home is the same directory as the home the facts checked, so +/// that path names the same file and resolves to the same checked target. +fn invoked_executable( + canonical: &str, + canonical_home: &str, + layout: &Value, + facts: &Facts, +) -> Validation { + let layout_path = layout["path"].as_str().unwrap_or(""); + let name = |path: &str| { + let leaf = paths::file_name(path, &facts.platform); + if facts.case_sensitive { + leaf.to_owned() + } else { + leaf.to_lowercase() + } + }; + if name(canonical) == name(layout_path) { + return Ok(canonical.to_owned()); + } + paths::join(canonical_home, layout_path, &facts.platform) + .ok_or_else(|| reject(UNSAFE, "executableLayouts", "Invalid executable layout.")) +} + /// Validates an external installation against trusted, authority-local native facts. -/// Returns canonical home/executable paths without touching the native filesystem. +/// Returns the canonical home and the executable to start (the canonical target, or the +/// layout path when that target has another file name) +/// without touching the native filesystem. /// Project-code candidates require their separate consumer trust policy. pub fn validate_installation( home: &str, diff --git a/shared/plugins/contract/v1/toolchains/README.md b/shared/plugins/contract/v1/toolchains/README.md index 1ab3b857..529a6696 100644 --- a/shared/plugins/contract/v1/toolchains/README.md +++ b/shared/plugins/contract/v1/toolchains/README.md @@ -308,7 +308,11 @@ platform,workspaceRoot,filesystem}` and accepts `workspaceRoots`, document. Probes are host observations `{executable,output,exitCode}` keyed by the executable a selection reports (canonical for external installations, lexical for `fixed:{executable}` and `projectFile` candidates); system installations are -`{tool,home}`. +`{tool,home}`. When an external installation's layout file links to a file with +another name, the reported executable is that layout path beneath the canonical +home instead: a multi-call program such as rustup links `cargo` to itself and picks +the tool from the name it starts with, so starting the link target would run the +wrong program. The facts still check the target's kind, mode and containment. Shell environment home variables and `commandHomes` come from the native login-shell adapter, not command-name guessing. An environment candidate selects only through its declared `path` layout. diff --git a/shared/plugins/reference/domains/toolchains.md b/shared/plugins/reference/domains/toolchains.md index d2b2e686..7166c0ba 100644 --- a/shared/plugins/reference/domains/toolchains.md +++ b/shared/plugins/reference/domains/toolchains.md @@ -31,6 +31,8 @@ 版本探针 `version.arguments` 的第一个参数可以是选项(`-version`、`--version`),也可以是子命令(Go 这类只用 `go version` 打印版本的工具写 `version`);之后的参数只能是选项,选项不带 `=值`。第一个参数之后出现不带 `-` 的词就拒绝,所以探针不会把脚本、文件之类的操作数交给工具。 +外部安装报告的可执行文件是解析掉链接后的规范路径。例外是 `executableLayouts` 里的文件链接到另一个文件名:这时报告规范主目录下的布局路径。rustup 把 `cargo`、`rust-analyzer` 链接到自身,按启动时的名字决定运行哪个工具,从链接目标启动只会运行 rustup;版本探针和启动都用布局路径。 + ### 选择顺序 | 层 | 规则 | @@ -219,6 +221,8 @@ The declarative primitives are frozen: root kinds are `home`, `environment`, and The first argument of the version probe `version.arguments` is a flag (`-version`, `--version`) or a subcommand (`version`, for a tool such as Go that prints its version only with `go version`); every later argument is a flag, and flags carry no `=value`. A bare word after the first argument is refused, so a probe never hands the tool an operand such as a script or a file. +An external installation reports its canonical executable, with links resolved. The exception is a file in `executableLayouts` that links to a file with another name: Core then reports the layout path beneath the canonical home. rustup links `cargo` and `rust-analyzer` to itself and picks the tool from the name it starts with; started by the link target's name it runs rustup. Version probes and launches use the layout path. + ### Selection order | Layer | Rule | diff --git a/shared/plugins/reference/protocol-changelog.md b/shared/plugins/reference/protocol-changelog.md index 73354ba3..816dda11 100644 --- a/shared/plugins/reference/protocol-changelog.md +++ b/shared/plugins/reference/protocol-changelog.md @@ -14,16 +14,6 @@ ## 待合入 -- [#133](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/133),[@xiaoyumuxi](https://github.com/xiaoyumuxi),**`commandInstallers` 1**(API-23):命令安装新增[下载安装](../contract/v1/README.md#download-installers):安装声明 `download`(与 `tool`、`minimumVersion`、`arguments` 互斥),固定上游 `version` 和 1–6 个平台归档,每个归档有 `os`、`arch`、HTTPS `url`、可选 `mirrors`(最多 8 个)、完整 `sha256`、`archive`(`zip`/`tar.gz`)和可选 `stripPrefix`,规则与 `managedRuntimes` 归档相同;只能用 `managed` 目标,不带 `arguments`、`environment`,`commandDirectory` 相对解压根目录,`mayUseNetwork` 必须为 `true`。`plugins.commandInstallers.requirements` 和 `plan` 新增可选 `platform: {os, arch}`:带上时没有该平台归档的下载安装不提供;安装条目新增 `download: null | {version}`;计划新增 `download`(工具安装为 `null`,下载安装为选中平台的归档、`cacheKey` 和 `commandDirectory`)。新增 Core 错误码 `plugin.commandInstaller.platformInvalid`、`unavailable`,宿主错误码 `plugin.commandInstaller.downloadFailed`、`checksumMismatch`、`archiveInvalid`;`failed` 只指工具安装失败。下载安装的审查程序列出全部归档,改地址、镜像、摘要或版本需要重新批准;只声明 `commandInstallers` 0 的宿主拒绝安装带下载安装的插件。没有新增宿主方法、通知或 SDK 版本。用于 Rust Support 插件按需下载 CodeLLDB。 - -- [#130](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/130),[@1lck](https://github.com/1lck),**工作区插件推荐**:市场契约新增同级推荐索引格式 `plugin-recommendations.schema.json`(`schemaVersion: 0`,独立于只增不破旧版的 `lithe-plugin-index.json`);`plugins.marketplace.resolveSource` 额外返回 `recommendationsURL`,并新增宿主内部 Core 命令 `plugins.marketplace.recommendForWorkspace`(不是插件 RPC),基于工作区采集文件名与已有市场索引匹配可安装的缺失插件。见 [1lck/Lithe-IDEA#2228](https://github.com/1lck/Lithe-IDEA/issues/2228)。 - -- [#127](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/127),[@Mucheen](https://github.com/Mucheen),**API-25**:从 `grammar.path` 指定的 TextMate 语法或独立的 `grammars/.first-line.json` 读取可选 `firstLineMatch`。独立文件可沿用宿主现有高亮。旧桌面仍可安装 `languages: 0` 的同一插件包。Core 解码返回可选提示并匹配完整首行,既有路径与用户关联优先。见 [1lck/Lithe-IDEA#2122](https://github.com/1lck/Lithe-IDEA/issues/2122)。 - -- [#128](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/128),[@xiaoyumuxi](https://github.com/xiaoyumuxi),`pluginAPIVersion` 0 内的补充(API-23、API-29):`run/start` 的 `process` 和提供者 `lithe/build/prepareRun` 的返回值新增可选 `outputEncoding`,用稳定编码 ID 或别名声明进程写入管道的编码;Core 校验并规范化,拒绝未知或不兼容 ASCII 的编码。用户固定编码优先;自动模式逐行尝试声明、UTF-8,以及仅 Windows 的 GBK。省略字段时所有平台默认 UTF-8,Windows 兼容 GBK;不修改进程环境或终端代码页。新增宿主内部 Core 命令 `outputEncoding.resolve`,返回同一解析规则的候选与可选编码列表,不是插件 RPC。见 [1lck/Lithe-IDEA#2186](https://github.com/1lck/Lithe-IDEA/issues/2186)。 - -- [#112](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/112),[@Mucheen](https://github.com/Mucheen),**`buildSystems` 1**(API-29):清单新增 `buildSystems[].test.discoveryCommand`,已有测试运行可以独立采用命令或 provider。命令使用现有构建工具,把 `litheTestDiscovery` v0 写到宿主提供的 `${outputFile}`。Core 的 `build.testDiscoveryPlan`、`build.decodeTestDiscovery` 和测试树兼容两种发现来源,检查每条选择器可原样运行,命令尝试沿用 `lithe/build/discoverTests` 的结构化终态。没有新增宿主方法、通知或 SDK 版本。见 [1lck/Lithe-IDEA#2122](https://github.com/1lck/Lithe-IDEA/issues/2122)。 - ## 按协议查首次出现 所有版本都从 `0` 开始。以后一个 PR 给某个能力加版本 `1` 时,在对应的表里为它加一行。 @@ -41,7 +31,7 @@ | 插件网页桥 `window.lithe.version` | 0 | 2026-11-11 | [#17](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/17) | | `litheSettingsSources`、`litheSettingsSourceEdit` | 0 | 2026-11-15 | [#57](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/57) | -| 市场推荐索引 `schemaVersion` | 0 | 待合入 | [#130](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/130) | +| 市场推荐索引 `schemaVersion` | 0 | 2026-11-20 | [#130](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/130) | ### 能力版本(`requires`) @@ -54,9 +44,9 @@ | `buildProviders` | 0 | 2026-11-11 | [#17](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/17) | | `buildProviders` | 1 | 2026-11-18 | [#89](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/89) | | `buildSystems` | 0 | 2026-11-11 | [#17](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/17) | -| `buildSystems` | 1 | 待合入 | [#112](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/112) | +| `buildSystems` | 1 | 2026-11-19 | [#112](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/112) | | `commandInstallers` | 0 | 2026-11-15 | [#53](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/53) | -| `commandInstallers` | 1 | 待合入 | [#133](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/133) | +| `commandInstallers` | 1 | 2026-11-20 | [#133](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/133) | | `debugAdapters` | 0 | 2026-11-11 | [#17](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/17) | | `executionProviders` | 0 | 2026-11-11 | [#17](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/17) | | `keymapImportProviders` | 0 | 2026-11-11 | [#17](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/17) | @@ -153,15 +143,25 @@ | — | `keymapImport/listInputs` | 0 | 2026-11-11 | [#17](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/17) | | — | `keymapImport/readChunk` | 0 | 2026-11-11 | [#17](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/17) | | API-23 | `run/start`:`temporaryFiles` 增加 `{name, base64}` 字节文件 | 0 | 2026-11-13 | [#23](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/23) | -| API-23 | `run/start`:`process.outputEncoding` 可选声明 | 0 | 待合入 | [#128](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/128) | -| API-29 | `lithe/build/prepareRun`:返回值 `outputEncoding` 可选声明(提供者方法) | `litheBuild` 0、1 | 待合入 | [#128](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/128) | +| API-23 | `run/start`:`process.outputEncoding` 可选声明 | 0 | 2026-11-20 | [#128](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/128) | +| API-29 | `lithe/build/prepareRun`:返回值 `outputEncoding` 可选声明(提供者方法) | `litheBuild` 0、1 | 2026-11-20 | [#128](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/128) | ## 时间线(新的在上) +### 2026-11-20 + +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#133](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/133) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-23 | **`commandInstallers` 1** | 命令安装新增[下载安装](../contract/v1/README.md#download-installers):安装声明 `download`(与 `tool`、`minimumVersion`、`arguments` 互斥),固定上游 `version` 和 1–6 个平台归档,每个归档有 `os`、`arch`、HTTPS `url`、可选 `mirrors`(最多 8 个)、完整 `sha256`、`archive`(`zip`/`tar.gz`)和可选 `stripPrefix`,规则与 `managedRuntimes` 归档相同;只能用 `managed` 目标,不带 `arguments`、`environment`,`commandDirectory` 相对解压根目录,`mayUseNetwork` 必须为 `true`。`plugins.commandInstallers.requirements` 和 `plan` 新增可选 `platform: {os, arch}`:带上时没有该平台归档的下载安装不提供;安装条目新增 `download: null | {version}`;计划新增 `download`(工具安装为 `null`,下载安装为选中平台的归档、`cacheKey` 和 `commandDirectory`)。新增 Core 错误码 `plugin.commandInstaller.platformInvalid`、`unavailable`,宿主错误码 `plugin.commandInstaller.downloadFailed`、`checksumMismatch`、`archiveInvalid`;`failed` 只指工具安装失败。下载安装的审查程序列出全部归档,改地址、镜像、摘要或版本需要重新批准;只声明 `commandInstallers` 0 的宿主拒绝安装带下载安装的插件。没有新增宿主方法、通知或 SDK 版本。用于 Rust Support 插件按需下载 CodeLLDB。 | +| [#130](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/130) | [@1lck](https://github.com/1lck) | — | **市场推荐索引 `schemaVersion` 0** | 市场契约新增同级推荐索引格式 `plugin-recommendations.schema.json`(`schemaVersion: 0`,独立于只增不破旧版的 `lithe-plugin-index.json`);`plugins.marketplace.resolveSource` 额外返回 `recommendationsURL`,并新增宿主内部 Core 命令 `plugins.marketplace.recommendForWorkspace`(不是插件 RPC),基于工作区采集文件名与已有市场索引匹配可安装的缺失插件。见 [1lck/Lithe-IDEA#2228](https://github.com/1lck/Lithe-IDEA/issues/2228)。 | +| [#128](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/128) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-23、API-29 | `pluginAPIVersion` 0 内的补充 | `run/start` 的 `process` 和提供者 `lithe/build/prepareRun` 的返回值新增可选 `outputEncoding`,用稳定编码 ID 或别名声明进程写入管道的编码;Core 校验并规范化,拒绝未知或不兼容 ASCII 的编码。用户固定编码优先;自动模式逐行尝试声明、UTF-8,以及仅 Windows 的 GBK。省略字段时所有平台默认 UTF-8,Windows 兼容 GBK;不修改进程环境或终端代码页。新增宿主内部 Core 命令 `outputEncoding.resolve`,返回同一解析规则的候选与可选编码列表,不是插件 RPC。见 [1lck/Lithe-IDEA#2186](https://github.com/1lck/Lithe-IDEA/issues/2186)。 | +| [#127](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/127) | [@Mucheen](https://github.com/Mucheen) | API-25 | `languages` 0 内的补充 | 从 `grammar.path` 指定的 TextMate 语法或独立的 `grammars/.first-line.json` 读取可选 `firstLineMatch`。独立文件可沿用宿主现有高亮。旧桌面仍可安装 `languages: 0` 的同一插件包。Core 解码返回可选提示并匹配完整首行,既有路径与用户关联优先。见 [1lck/Lithe-IDEA#2122](https://github.com/1lck/Lithe-IDEA/issues/2122)。 | + ### 2026-11-19 | PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | | --- | --- | --- | --- | --- | +| [#112](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/112) | [@Mucheen](https://github.com/Mucheen) | API-29 | **`buildSystems` 1** | 清单新增 `buildSystems[].test.discoveryCommand`,已有测试运行可以独立采用命令或 provider。命令使用现有构建工具,把 `litheTestDiscovery` v0 写到宿主提供的 `${outputFile}`。Core 的 `build.testDiscoveryPlan`、`build.decodeTestDiscovery` 和测试树兼容两种发现来源,检查每条选择器可原样运行,命令尝试沿用 `lithe/build/discoverTests` 的结构化终态。没有新增宿主方法、通知或 SDK 版本。见 [1lck/Lithe-IDEA#2122](https://github.com/1lck/Lithe-IDEA/issues/2122)。 | | [#122](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/122) | [@1lck](https://github.com/1lck) | API-29、API-37 | `buildSystems` 0 内的补充 | 包内翻译文件新增 `buildOptions..`,可翻译构建选项的 `displayName`、`description` 和固定选项值的 `title`,规则与 `runConfigurationTypes` 相同,不合规时整份拒绝,错误码 `plugin.build.invalidLocalization`。新 Core 命令 `build.localizeOptions` 接收已启用构建插件的清单和界面语言,采用两阶段读取翻译文件(与 `runConfig.configurationTypes` 相同),返回替换了选项文字的清单,宿主用它检测,选项对话框、工具栏开关和构建树都显示译文。插件清单、宿主方法、通知和能力版本都不变;旧 Core 会忽略翻译文件中的 `buildOptions`。见 [1lck/Lithe-IDEA#2204](https://github.com/1lck/Lithe-IDEA/issues/2204)。 | | [#121](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/121) | [@1lck](https://github.com/1lck) | API-29 | `buildSystems` 0 内的行为修正 | `build.resolveOptions` 对没有声明 `default` 的 `text`、`file`、`directory` 选项,用户覆盖时也返回 `implicitValue`,作为撤销覆盖后回到的值,宿主据此保留“覆盖”复选框。没有新增字段、版本号、宿主方法或通知。见 [1lck/Lithe-IDEA#2152](https://github.com/1lck/Lithe-IDEA/issues/2152)。 | | [#120](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/120) | [@1lck](https://github.com/1lck) | API-29 | `buildSystems` 0 内的补充 | 清单的 `options[]` 新增 `description`(1–512 字符),作为宿主 ⓘ 中的说明,只用于显示。`litheBuildModel` 和 `model.map` 的 `optionDefaults` 除 `choicesFromModel` 选项外,也可以填 `text`、`file`、`directory` 选项,值是选项未设置时工具实际使用的那一个(如 Maven 的用户设置文件和本地仓库),Core 只保留第一个值。`build.resolveOptions` 对未设置的这类选项返回 `implicitValue`,并返回 `description`。`implicitValue` 只用于显示,不生成参数,也不进入选项指纹。旧 Core 会拒绝声明了 `description` 或给路径选项填 `optionDefaults` 的清单。没有新增版本号、宿主方法、通知或 SDK 版本。见 [1lck/Lithe-IDEA#2152](https://github.com/1lck/Lithe-IDEA/issues/2152)、[#2204](https://github.com/1lck/Lithe-IDEA/issues/2204)。 | From 8291f3c26f0aa8bc5db8a948608bdf7e8f9c5ad6 Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Fri, 20 Nov 2026 23:19:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs(plugins):=20=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AE=B0=E5=BD=95=E7=99=BB=E8=AE=B0=20#135?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/plugins/reference/protocol-changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared/plugins/reference/protocol-changelog.md b/shared/plugins/reference/protocol-changelog.md index 816dda11..548fe34c 100644 --- a/shared/plugins/reference/protocol-changelog.md +++ b/shared/plugins/reference/protocol-changelog.md @@ -14,6 +14,8 @@ ## 待合入 +- [#135](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/135),[@xiaoyumuxi](https://github.com/xiaoyumuxi),`toolDefinitions` 0 内的行为修正(API-23):外部安装的 `executableLayouts` 文件链接到另一个文件名时,`toolchains.candidates` 的待探针路径和 `toolchains.resolve` 的 `executable` 改为规范主目录下的布局路径,不再是链接目标。rustup 把 `cargo`、`rust-analyzer` 链接到自身、按启动时的名字决定运行哪个工具,以前 Core 返回 `rustup`,版本探针失败。链接目标的类型、可执行位和越界检查不变;同名链接仍返回规范路径。没有新增字段、版本号、宿主方法、通知或 SDK 版本。 + ## 按协议查首次出现 所有版本都从 `0` 开始。以后一个 PR 给某个能力加版本 `1` 时,在对应的表里为它加一行。