Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions shared/plugins/reference/domains/toolchains.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
| `toolchains.decodeReply` | 查询请求、提供者应答、宿主观察到的文件系统事实 | `snapshot` | 校验一次 `toolchains/query` 应答,得到 `{installations, statements, watch, diagnostics}` |
| `toolchains.failureReply` | `{params, code}` | `reply` | 查询没有应答时生成对应的 JSON-RPC 错误;`code` 只能是 `plugin.toolchain.timeout` 或 `plugin.toolchain.providerUnavailable` |
| `toolchains.resolvePins` | `{document, directory, tool}` | `resolution` | 在 `local.json` 里找最近的固定,返回 `{pin, sourceDirectory}` |
| `toolchains.resolve` | 某个目录的完整解析输入 | `resolution` | 走四层选择,结果是 `resolved`、`skip` 或 `terminalFailure`,附带 `trace`、`projectCandidates`、`unmet`、`conflicts` |
| `toolchains.resolve` | 工作区目录或[无工作区的全局解析](../../contract/v1/toolchains/README.md#pins-and-snapshot-resolution) | `resolution` | 走四层选择,结果是 `resolved`、`skip` 或 `terminalFailure`,附带 `trace`、`projectCandidates`、`unmet`、`conflicts` |
| `toolchains.checkVersion` | `{registry, tool, output, minimumVersion?}` | `version` | 用定义的版本正则取版本并比较;最多 8 段数字、64 字节,不解释别名 |
| `toolchains.instantiateLaunch` | `{registry, tool, executable, home?, entry?, runtimeArguments, arguments}` | `launch` | 按工具定义的 `launch` 模板,为宿主选中的可执行文件展开启动参数,返回 `{executable, arguments, versionArguments}`;见“按工具定义 ID 启动进程” |
| `toolchains.discoveryPlan` | `{registry, platform}` | `plan` | 每个工具的扫描计划、声明它的提供者、登录 shell 变量和平台过滤后的 `projectFiles`;最多 256 个根目录、4096 个条目、64 层祖先 |
Expand Down Expand Up @@ -252,7 +252,7 @@ Every command accepts UTF-8 JSON, has a 4 MiB input budget, and performs no nati
| `toolchains.decodeReply` | The query request, the provider's reply, and the host's observed filesystem facts | `snapshot` | Validates one `toolchains/query` reply and returns `{installations, statements, watch, diagnostics}` |
| `toolchains.failureReply` | `{params, code}` | `reply` | Builds the JSON-RPC error when a query gets no reply. `code` is `plugin.toolchain.timeout` or `plugin.toolchain.providerUnavailable` |
| `toolchains.resolvePins` | `{document, directory, tool}` | `resolution` | Finds the nearest pin in `local.json`; returns `{pin, sourceDirectory}` |
| `toolchains.resolve` | The full resolution input for one directory | `resolution` | Runs the four layers. The result is `resolved`, `skip`, or `terminalFailure`, with `trace`, `projectCandidates`, `unmet`, and `conflicts` |
| `toolchains.resolve` | A workspace directory or [global resolution without a workspace](../../contract/v1/toolchains/README.md#pins-and-snapshot-resolution) | `resolution` | Runs the four layers. The result is `resolved`, `skip`, or `terminalFailure`, with `trace`, `projectCandidates`, `unmet`, and `conflicts` |
| `toolchains.checkVersion` | `{registry, tool, output, minimumVersion?}` | `version` | Reads the version with the definition's regular expression and compares it. At most 8 numeric parts and 64 bytes; aliases are not interpreted |
| `toolchains.instantiateLaunch` | `{registry, tool, executable, home?, entry?, runtimeArguments, arguments}` | `launch` | Expands the definition's `launch` template for the executable the host selected, returning `{executable, arguments, versionArguments}`; see "Launching a process by tool-definition ID" |
| `toolchains.discoveryPlan` | `{registry, platform}` | `plan` | Each tool's scan plan, the providers that declare it, login-shell variables, and platform-filtered `projectFiles`. Limits: 256 roots, 4096 entries, 64 ancestors |
Expand Down
1 change: 1 addition & 0 deletions shared/plugins/reference/protocol-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@

| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 |
| --- | --- | --- | --- | --- |
| [#111](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/111) | [@Mucheen](https://github.com/Mucheen) | API-23 | `toolchainProviders` 0 内的修正 | 无项目时,`toolchains.resolve` 可使用同一代次的全局提供者回包。解析目录为 `.`,查询的 `workspace` 和 `context` 显式为 `null`,解析上下文也为空。工作区查询继续校验根目录和相对目录,两种查询都核对文件系统快照及排除根。 |
| [#113](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/113) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | `pluginAPIVersion` 0 内的说明补充(官方 SDK 新增 Go) | Go 插件后端 SDK 放在 `shared/plugins/sdk/go`,模块路径 `github.com/Lithe-IDEA/Lithe-core-rust/shared/plugins/sdk/go`,需要 Go 1.22 或更高版本,只用标准库,按模块标签 `shared/plugins/sdk/go/v<版本>` 发布(还没有推送标签)。它实现函数协议和宿主服务(凭据、工作区、文档与编辑器、预览、浏览器、窗口消息、`functions/providers` 与 `functions/invoke`、原生终端、订阅)、插件视图 `View(id, handler)` 和 `litheKeymapImport` 0,不实现构建和 VCS 提供者。契约 README 的 Official backend SDK 加上 `sdk/go` 一段:在 Unix 上把协议移到 stdout 的副本、stdout 指向 stderr,处理函数 panic 只结束这一次调用。Go 示例后端和 Rust 示例后端跑同一个插件后端场景,`sdk-e2e.mjs` 新增 `plugin_sdk_go`。插件总览、日志指南和各参考页列出 Go SDK,并推荐新插件优先用 Rust 或 Go SDK(构建后端照旧用 Node.js 或 Java SDK,VCS 后端用 Node.js SDK)。没有新增版本号、宿主方法、通知或协议字段。 |
| [#109](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/109) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-13 | `ui` 0 内的补充(API-13) | 视图事件新增 `width` 和 `resize`,画布可以跟随窗口宽度重新排版。会报告宽度的宿主在每个视图事件里带 `width`(排版视图节点用的宽度,单位为点,至少为 1 的整数,也是顶层画布的宽度),并且量到宽度之后才发 `open`;画布的 `on` 除 `viewport` 外可以写 `resize`,视图里有这样的画布时,宽度停止变化 400 ms 后宿主发 `resize` 和新的 `width`,等待中的 `resize` 可以合并成最新的一个。插件只有在收到带 `width` 的事件后才写 `resize`:不报告宽度的宿主不发 `resize`,它的 Core 也会拒绝写了 `resize` 的画布。契约 README 同时写明画布在缩放 1 时怎样放 `viewBox`:不写 `pan` 时显示整个 `viewBox`,按视图宽度缩放但不超过 `height`,从区域左上角开始;写了 `pan` 时宽度占满视图、上边对齐区域顶部,缩小到比区域窄时水平居中。以前的说明只有“按视图宽度缩放、`height` 点高”,在更宽的窗口里会裁掉场景下半部分。Core 的画布校验接受 `on: ["viewport", "resize"]`,`plugin-ui.schema.json` 的 canvas 说明和 `on` 同步;Rust SDK 新增 `ViewEventKind::Resize` 和 `ViewEvent::width`,Java SDK 新增 `Kind.RESIZE` 和 `width()`,Node SDK 的 `ViewEventKind` 加上 `resize`、`ViewEvent` 加上 `width`、画布 `on` 的类型放宽,三个 SDK 的 README 补充用法;`domains/settings.md` 中英两段说明区域画布怎样按 `width` 排版,以及旧宿主下的固定宽度(语言页约 610 点、构建系统页和编译器页右侧详情约 340 点)([1lck/Lithe-IDEA#2181](https://github.com/1lck/Lithe-IDEA/issues/2181))。没有新增能力版本、宿主方法、通知或 SDK 版本,取代 [#107](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/107)。 |
| [#108](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/108) | [@1lck](https://github.com/1lck) | API-23 | **`managedRuntimes` 1** | 受管运行时的每个平台归档可以写 `mirrors`:最多 8 个备用 HTTPS 地址,提供与 `url` 同一个 SHA-256 固定的归档,不改变 `cacheKey`。Core 要求镜像地址不带凭据和片段、彼此不同且不同于 `url`;写了 `mirrors` 却没有声明 `managedRuntimes: 1` 的清单被拒绝,其他插件继续写 0。清单 schema 的 `requires.managedRuntimes` 加上版本 1、平台归档加上 `mirrors`;[能力与协议版本对照](capabilities-and-versions.md)把 `managedRuntimes` 0 的桌面端一列改为 ✅,新增版本 1 一行。没有新增宿主方法、通知或 SDK 版本。宿主须先声明 `managedRuntimes` 1,插件才可要求它。 |
Expand Down