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/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Schema 只检查 JSON 结构。ID 引用、权限、激活事件、模板变量

只用语言服务器、运行和测试的插件不需要后端。需要构建后端(`buildProviders`)、插件函数,或给插件自己的网页配一个后端进程(`backend`)时,用官方 SDK 写:协议、取消、进程清理和错误处理由 SDK 负责,你只写处理函数。

**新插件优先用 Rust 或 Go SDK。** 两者把后端编译成每个平台各一份的原生可执行文件,用户机器上不需要 Node.js 或 Java 运行时,常驻的后端也不会多占一份 JVM 的内存和启动时间。插件管理的是 JVM 工具(例如 Maven、Gradle、Tomcat)时也一样:后端用 Rust 或 Go 启动这些工具的进程即可。只有后端必须在 JVM 里直接调用 Java 库时,才用 Java SDK。构建后端(`buildProviders`)目前只有 Node.js 和 Java SDK 支持,VCS 后端只有 Node.js SDK 支持,这两类后端照旧用它们。
**新插件优先用 Rust 或 Go SDK。** 两者把后端编译成每个平台各一份的原生可执行文件,用户机器上不需要 Node.js 或 Java 运行时,常驻的后端也不会多占一份 JVM 的内存和启动时间。插件管理的是 JVM 工具(例如 Maven、Gradle、Tomcat)时也一样:后端用 Rust 或 Go 启动这些工具的进程即可。只有后端必须在 JVM 里直接调用 Java 库时,才用 Java SDK。构建后端(`buildProviders`)的发布版目前只有 Node.js 和 Java SDK 支持;`main` 上的 Rust SDK 源码也支持,随下一次 Rust SDK 发布提供,在那之前可以用 Git 依赖锁定包含它的 commit。VCS 后端只有 Node.js SDK 支持,照旧用它。

| SDK | 版本 | 运行时 | Release | 怎么放进插件 |
| --- | --- | --- | --- | --- |
Expand Down Expand Up @@ -324,7 +324,7 @@ A schema checks only JSON structure. Rules such as ID references, permissions, a

A plugin that uses only language servers, run, and test needs no backend. When you need a build backend (`buildProviders`), plugin functions, or a backend process for the plugin's own web page (`backend`), write it with an official SDK: the SDK handles the protocol, cancellation, process cleanup, and errors, and you write only the handlers.

**New plugins should prefer the Rust or Go SDK.** Both compile the backend to one native executable per platform, so users need no Node.js or Java runtime, and a long-running backend does not cost an extra JVM heap and startup. The same holds when the plugin manages JVM tools such as Maven, Gradle, or Tomcat: a Rust or Go backend starts those tools as processes. Use the Java SDK only when the backend must call Java libraries inside the JVM. Build backends (`buildProviders`) are supported only by the Node.js and Java SDKs today, and VCS backends only by the Node.js SDK, so keep using those for them.
**New plugins should prefer the Rust or Go SDK.** Both compile the backend to one native executable per platform, so users need no Node.js or Java runtime, and a long-running backend does not cost an extra JVM heap and startup. The same holds when the plugin manages JVM tools such as Maven, Gradle, or Tomcat: a Rust or Go backend starts those tools as processes. Use the Java SDK only when the backend must call Java libraries inside the JVM. Among released SDKs, build backends (`buildProviders`) are supported only by the Node.js and Java SDKs; the Rust SDK source on `main` supports them too and ships in the next Rust SDK release, and until then a Git dependency can pin a commit that contains it. VCS backends are supported only by the Node.js SDK, so keep using it for them.

| SDK | Version | Runtime | Release | How it goes into the plugin |
| --- | --- | --- | --- | --- |
Expand Down
9 changes: 5 additions & 4 deletions shared/plugins/contract/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4766,10 +4766,11 @@ mapping, with one difference: on Java 8 it stops only a cancelled tool's
direct child, and the host's process scope ends the rest.

[`sdk/rust`](https://github.com/Lithe-IDEA/Lithe-core-rust/blob/main/shared/plugins/sdk/rust/README.md) is the SDK for
[plugin backends](#plugin-backend), which ship as packaged executables. It
implements this protocol with its host services, but neither build nor VCS
providers. It needs Rust 1.87 or newer, depends only on `serde_json`, and is
released (`sdk-rust-v<version>`) as a `.crate` archive with its SHA-256, or
[plugin backends](#plugin-backend) and own-process
[build providers](#build-providers), which ship as packaged executables. It
implements this protocol with its host services and `litheBuild`, but not VCS
providers. It needs Rust 1.87 or newer, depends only on `serde`, `serde_json`
and `base64`, and is released (`sdk-rust-v<version>`) as a `.crate` archive with its SHA-256, or
used as a Git dependency pinned by the tag. It enforces the same rules: on Unix it
points stdout at stderr so only protocol frames reach the host, and a panic
ends only its call, reported like any unexpected failure.
Expand Down
10 changes: 4 additions & 6 deletions shared/plugins/guides/build-tool-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ LSP 服务器负责语言分析,构建工具负责项目导入、编译、依
> **宿主支持。** 目前唯一的宿主是 Lithe 桌面端,下文的“宿主”都指它。它声明 `buildSystems`、`buildProviders` 和 `debugAdapters`,
> **不声明 `executionProviders`**:`requires` 里有它的插件(第 2、3 节的运行和测试声明)不会被提供安装,所以这两节的清单按契约是有效的,
> 但不能在桌面端安装和运行。要在桌面端运行固定命令或构建任务,用第 5 节的构建系统。
> 桌面端的 Build 窗口检测构建实例、加载提供者模型、解析可执行文件候选并运行命令任务和提供者任务;构建提供者的运行准备、测试、
> 调试准备、模型输入、原生配置、内联测试报告、运行时调试,以及构建系统的实例选项和任务准备尚未呈现。
> 桌面端的 Build 窗口检测构建实例、加载提供者模型、解析可执行文件候选、运行命令任务和提供者任务、准备应用启动和原生程序调试,
> 并发现和运行提供者测试;构建提供者的模型输入、原生配置、内联测试报告、运行时调试,以及构建系统的实例选项和任务准备尚未呈现。
> 完整声明和说明见 [`pluginhost.go`](https://github.com/1lck/Lithe-IDEA/blob/main/desktop/internal/pluginhost/pluginhost.go)
> 中 `Declared()` 上方的注释,各能力的对照见[能力与协议版本对照](../reference/capabilities-and-versions.md)。
> 对本文有疑问,请到 [Lithe-core-rust 的 Issues](https://github.com/Lithe-IDEA/Lithe-core-rust/issues) 反馈。
Expand Down Expand Up @@ -156,7 +156,6 @@ Core 校验声明、检测实例、解码模型、展开命令行;桌面端执
[构建提供者](../reference/domains/build-providers.md),用 `litheBuild` 协议回答模型、任务、测试和运行准备请求。
字段见[构建系统](../reference/domains/build-systems.md);
运行原生程序、调试准备和终端见[原生构建工作流](native-build-workflows.md)。
注意桌面端目前不呈现构建提供者的测试、运行准备和调试准备,见开头的宿主支持。

可以参考实现的插件:

Expand Down Expand Up @@ -229,8 +228,8 @@ Finish the [LSP plugin lifecycle tutorial](lsp-plugin-lifecycle.md) first, then
> and **does not declare `executionProviders`**: a plugin whose `requires` lists it (the run and test declarations of sections 2 and 3) is not offered for install,
> so the manifests in those two sections are valid under the contract but cannot be installed or run on the desktop.
> To run a fixed command or a build task on the desktop, use the build system of section 5.
> The desktop's Build window detects build instances, loads provider models, resolves executable candidates, and runs command tasks and provider tasks; build-provider run preparation, tests,
> debug preparation, model inputs, native configuration, inline test reports, runtime debugging, and build-system instance options and task preparations are not presented yet.
> The desktop's Build window detects build instances, loads provider models, resolves executable candidates, runs command and provider tasks, prepares application launches and native program debugging,
> and discovers and runs provider tests; build-provider model inputs, native configuration, inline test reports, runtime debugging, and build-system instance options and task preparations are not presented yet.
> The full declarations and notes are in the comment above `Declared()` in [`pluginhost.go`](https://github.com/1lck/Lithe-IDEA/blob/main/desktop/internal/pluginhost/pluginhost.go);
> for a per-capability comparison see the [capability and protocol versions](../reference/capabilities-and-versions.md).
> Questions about this guide go to [Lithe-core-rust Issues](https://github.com/Lithe-IDEA/Lithe-core-rust/issues).
Expand Down Expand Up @@ -384,7 +383,6 @@ When only a program can compute the model (the Gradle Tooling API, for example),
model, task, test, and run-preparation requests over the `litheBuild` protocol.
For fields see [build systems](../reference/domains/build-systems.md);
for running native programs, debug preparation, and terminals see [native build workflows](native-build-workflows.md).
Note that the desktop does not yet present build-provider tests, run preparation, or debug preparation; see the host support note at the top.

Plugins whose implementation you can read:

Expand Down
Loading
Loading