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
2 changes: 1 addition & 1 deletion .github/workflows/release-rust-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ jobs:
asset="lithe-plugin-sdk-rust-$VERSION.crate"
gh release create "$TAG" "dist/$asset" "dist/$asset.sha256" \
--title "Rust plugin SDK $VERSION" \
--notes "Official Rust plugin SDK $VERSION for Lithe plugin backends. Requires Rust 1.87 or newer and depends only on serde_json. Depend on the tag through Git, or pin the archive by its SHA-256 (\`$asset.sha256\`) and vendor the unpacked crate; see sdk/rust/README.md."
--notes "Official Rust plugin SDK $VERSION for Lithe plugin backends. Requires Rust 1.87 or newer and depends only on serde_json and base64. Depend on the tag through Git, or pin the archive by its SHA-256 (\`$asset.sha256\`) and vendor the unpacked crate; see sdk/rust/README.md."
4 changes: 2 additions & 2 deletions guides/native-terminals.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Open a native Lithe terminal from a plugin

These SDK wrappers are an **unreleased addition** and require a host that
advertises the terminal methods. The checked-in contract mirror is pinned to
These SDK wrappers ship from Node.js SDK 0.3.0, Java SDK 0.3.0, and Rust SDK
0.2.0, and require a host that advertises the terminal methods. The checked-in contract mirror is pinned to
the merged host change, [Lithe #1653](https://github.com/1lck/Lithe-IDEA/pull/1653),
at `f64d262c48f1ff5ad1778b301138596493a09ad5`. The mirror is generated by
`scripts/contract.mjs sync`, never edited manually. See the
Expand Down
4 changes: 2 additions & 2 deletions guides/plugin-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

新版本插件使用 `litheLogging` 1 与 `lithe/log` 发送受限的操作事实,由宿主的共享事件目录、脱敏、队列和文件写入器落盘。三个 SDK 不再提供自由文本 `log` 接口,也没有 stderr 回退。插件无需实现 v2 文件格式、文件轮转、脱敏器或后台写入线程。

宿主必须在 initialize 中提供 `capabilities.experimental.litheLogging.versions: [1]`,SDK 回复 `capabilities.experimental.litheLogging.version: 1`。缺少协议时,新 SDK 拒绝初始化;不自动退回旧日志。初始化尚未协商时的失败只通过原有 RPC 错误与宿主进程生命周期记录,不能提前发送未协商的日志通知。
宿主必须在 initialize 中提供 `capabilities.experimental.litheLogging.versions: [1]`,SDK 回复 `capabilities.experimental.litheLogging.version: 1`。缺少协议时,SDK 拒绝初始化;不自动退回旧日志。初始化尚未协商时的失败只通过原有 RPC 错误与宿主进程生命周期记录,不能提前发送未协商的日志通知。

本文描述源码中的新 API。插件本轮将源码与真实哈希一起固定在可复现的构建输入中;正式发布 SDK 后也可以改为锁定真实 release tag 与 SHA-256。不要引用不存在的发布版本或开发机的绝对 path 依赖。
本文的 API 从 Node.js SDK 0.3.0、Java SDK 0.3.0 和 Rust SDK 0.2.0 开始提供。插件在构建输入中锁定对应的 release tag 与 SHA-256,不要引用开发机的绝对 path 依赖。用这些版本构建的插件只能在提供 `litheLogging` 1 的 Lithe 版本上启动。

## 每种事实与级别

Expand Down
18 changes: 11 additions & 7 deletions sdk/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ same rules and error mapping:
cancellation, and registration at runtime. From version 2 a backend may
call [host services](#host-services); version 3 adds workspace, document,
editor, and window services, command events, and workspace contexts.
- **`litheKeymapImport` 1** (unreleased): independently negotiated shortcut
- **`litheKeymapImport` 1** (from 0.3.0): independently negotiated shortcut
import providers reading only explicitly selected source snapshots.

The SDK requires Java 8 or newer and has no runtime dependencies. JSON values
are plain `Map<String, Object>`, `List<Object>`, `String`, `Long`, `Double`,
`Boolean`, and `null` (see `Json`).

## Shortcut import providers (unreleased)
## Shortcut import providers

Declare `backend.keymapImportProvider(id, handler)` before listening. Its
Available from SDK 0.3.0. Declare `backend.keymapImportProvider(id, handler)` before listening. Its
handler receives a `KeymapSnapshot` with `providerId()`, `snapshotId()`,
`listInputs()` and `readChunk(fileId, offset, maximumBytes)`, plus the normal
call context. Paths returned by `listInputs` are relative labels; reads use
Expand Down Expand Up @@ -70,7 +70,9 @@ the same one the Node.js sample answers.

Releases are published on [this repository's Releases page](https://github.com/Lithe-IDEA/lithe-plugin-docs/releases) and
tagged `sdk-java-v<version>`. Version 0.2.0 adds plugin-function protocols 2
and 3. Version 0.1.0 was released from the Lithe
and 3. Version 0.3.0 adds shortcut import providers, native terminals, and typed
diagnostics through `litheLogging` 1, and removes the free-text `log` API.
Version 0.1.0 was released from the Lithe
repository before the SDK moved here; its
[release](https://github.com/1lck/Lithe-IDEA/releases/tag/sdk-java-v0.1.0)
stays available. A release ships
Expand All @@ -86,7 +88,9 @@ JAR it starts must hold everything it loads.

## Logging

The new SDK requires `experimental.litheLogging` version 1 at initialization.
From version 0.3.0, the SDK requires `experimental.litheLogging` version 1
at initialization and refuses a host that does not offer it, so a backend
built on 0.3.0 or later starts only in a Lithe release that offers it.
See [plugin logging](../../guides/plugin-logging.md) for the typed diagnostics
API, host-owned catalog, exact levels, operation correlation and `${logDir}`.
Use `diagnostics.degraded/recovered` (Rust: `diagnostics().degraded/recovered`)
Expand Down Expand Up @@ -302,9 +306,9 @@ The two native workflow samples demonstrate independent producer and consumer
backends in the Core end-to-end tests. Their engine is fictional; this does not
migrate Maven, JDT, LLDB or existing plugin business logic.

## Native terminal API (unreleased)
## Native terminal API

The SDK includes wrappers for plugin-owned native terminal create/show/close,
From version 0.3.0, the SDK includes wrappers for plugin-owned native terminal create/show/close,
reopen with bounded display history, disposal and exit subscriptions. These
methods are discovered within protocol 3; they require a newer host and
`terminal.create`, not a new protocol version. See
Expand Down
2 changes: 1 addition & 1 deletion sdk/java/examples/sample-build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.github.lithe-idea</groupId>
<artifactId>lithe-plugin-sdk-java-parent</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sdk/java/examples/sample-native-build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.github.lithe-idea</groupId>
<artifactId>lithe-plugin-sdk-java-parent</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sdk/java/plugin-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.github.lithe-idea</groupId>
<artifactId>lithe-plugin-sdk-java-parent</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
</parent>

<artifactId>lithe-plugin-sdk-java</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sdk/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>io.github.lithe-idea</groupId>
<artifactId>lithe-plugin-sdk-java-parent</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
<packaging>pom</packaging>

<modules>
Expand Down
18 changes: 11 additions & 7 deletions sdk/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ on stdio and implements Lithe's backend protocols from
- **`litheVcs` 1**: typed `lithe/vcs/*` requests, for a plugin's
`vcsProviders` entry, from the
[VCS provider contract](https://github.com/1lck/Lithe-IDEA/blob/preview/shared/contracts/vcs-provider-v1.md).
- **`litheKeymapImport` 1** (unreleased): independently negotiated shortcut
- **`litheKeymapImport` 1** (from 0.3.0): independently negotiated shortcut
import providers reading only explicitly selected source snapshots.

The SDK owns the wire format, negotiation, cancellation, process cleanup, and
error mapping. Your code supplies only handlers. Node 20.3 or newer is
required; declare it as the runtime's `minimumVersion`.

## Shortcut import providers (unreleased)
## Shortcut import providers

Declare `backend.keymapImportProvider(id, handler)` before listening. Its
Available from SDK 0.3.0. Declare `backend.keymapImportProvider(id, handler)` before listening. Its
handler receives a snapshot with `providerID`, `snapshotID`, `listInputs()`
and `readChunk(fileID, offset, maximumBytes)`, plus the normal call context.
Paths returned by `listInputs` are relative labels; reads use opaque file IDs.
Expand Down Expand Up @@ -115,7 +115,9 @@ real Core session.
## Getting the SDK

Releases are published on [this repository's Releases page](https://github.com/Lithe-IDEA/lithe-plugin-docs/releases) and
tagged `sdk-node-v<version>`. A release ships
tagged `sdk-node-v<version>`. Version 0.3.0 adds shortcut import providers, native terminals, and typed
diagnostics through `litheLogging` 1, and removes the free-text `log` API.
A release ships
`lithe-plugin-sdk-node-<version>.tgz` and a `.sha256` file holding the
archive's SHA-256. The SDK is not published to the npm registry. Use it like
this:
Expand All @@ -132,7 +134,9 @@ package. The SDK has no dependencies.

## Logging

The new SDK requires `experimental.litheLogging` version 1 at initialization.
From version 0.3.0, the SDK requires `experimental.litheLogging` version 1
at initialization and refuses a host that does not offer it, so a backend
built on 0.3.0 or later starts only in a Lithe release that offers it.
See [plugin logging](../../guides/plugin-logging.md) for the typed diagnostics
API, host-owned catalog, exact levels, operation correlation and `${logDir}`.
Use `diagnostics.degraded/recovered` (Rust: `diagnostics().degraded/recovered`)
Expand Down Expand Up @@ -361,9 +365,9 @@ The two native workflow samples demonstrate independent producer and consumer
backends in the Core end-to-end tests. Their engine is fictional; this does not
migrate Maven, JDT, LLDB or existing plugin business logic.

## Native terminal API (unreleased)
## Native terminal API

The SDK includes wrappers for plugin-owned native terminal create/show/close,
From version 0.3.0, the SDK includes wrappers for plugin-owned native terminal create/show/close,
reopen with bounded display history, disposal and exit subscriptions. These
methods are discovered within protocol 3; they require a newer host and
`terminal.create`, not a new protocol version. See
Expand Down
4 changes: 2 additions & 2 deletions sdk/node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lithe/plugin-sdk",
"version": "0.2.0",
"version": "0.3.0",
"description": "Official SDK for Lithe plugin backends: plugin functions and build providers over the LSP base protocol.",
"license": "Apache-2.0",
"private": true,
Expand Down
4 changes: 2 additions & 2 deletions sdk/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["plugin-sdk", "examples/sample-backend"]
resolver = "2"

[workspace.package]
version = "0.1.0"
version = "0.2.0"
edition = "2021"
license = "Apache-2.0"
# std::io::pipe, used by the tests.
Expand Down
20 changes: 12 additions & 8 deletions sdk/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ platform. It speaks the LSP base protocol on stdio and implements, from
by the host in the platform's secret store (the Keychain on macOS), and
from version 3 workspace contexts, files, documents, editors, preview,
the browser, window messages, commands, and subscriptions.
- **`litheKeymapImport` 1** (unreleased): independently negotiated shortcut
- **`litheKeymapImport` 1** (from 0.2.0): independently negotiated shortcut
import providers reading only explicitly selected source snapshots.

The SDK owns the wire format, negotiation, cancellation, and error mapping.
Expand All @@ -26,9 +26,9 @@ Build providers and VCS providers are not part of this SDK yet; write build
providers with the [Node.js](../node/README.md) or [Java](../java/README.md)
SDK, and VCS providers with the Node.js SDK.

## Shortcut import providers (unreleased)
## Shortcut import providers

Declare `keymap_import_provider(id, handler)` before listening. The host
Available from SDK 0.2.0. Declare `keymap_import_provider(id, handler)` before listening. The host
negotiates IDs independently of plugin functions; a handler receives a
`KeymapImportRequest` and a call-scoped `Context`. Use
`request.list_inputs(context.host())` and `request.read_chunk(context.host(),
Expand Down Expand Up @@ -88,7 +88,9 @@ the scenario in

Releases are published on
[this repository's Releases page](https://github.com/Lithe-IDEA/lithe-plugin-docs/releases)
and tagged `sdk-rust-v<version>`. The SDK is not published to crates.io.
and tagged `sdk-rust-v<version>`. Version 0.2.0 adds shortcut import providers, native terminals, and typed
diagnostics through `litheLogging` 1, and removes the free-text `log` API.
The SDK is not published to crates.io.
Either way below fetches it at build time, never at runtime, and pins its
exact contents:

Expand All @@ -97,7 +99,7 @@ exact contents:

```toml
[dependencies]
lithe-plugin-sdk = { git = "https://github.com/Lithe-IDEA/lithe-plugin-docs", tag = "sdk-rust-v0.1.0" }
lithe-plugin-sdk = { git = "https://github.com/Lithe-IDEA/lithe-plugin-docs", tag = "sdk-rust-v0.2.0" }
```

- **Vendored archive.** A release ships `lithe-plugin-sdk-rust-<version>.crate`
Expand All @@ -107,7 +109,9 @@ exact contents:

## Logging

The new SDK requires `experimental.litheLogging` version 1 at initialization.
From version 0.2.0, the SDK requires `experimental.litheLogging` version 1
at initialization and refuses a host that does not offer it, so a backend
built on 0.2.0 or later starts only in a Lithe release that offers it.
See [plugin logging](../../guides/plugin-logging.md) for the typed diagnostics
API, host-owned catalog, exact levels, operation correlation and `${logDir}`.
Use `diagnostics.degraded/recovered` (Rust: `diagnostics().degraded/recovered`)
Expand Down Expand Up @@ -312,9 +316,9 @@ host; `tests/host_services.rs` checks the host services against the
contract's fixture. The end-to-end check builds the sample, installs it as a
package, and runs it through a real Core session.

## Native terminal API (unreleased)
## Native terminal API

The SDK includes wrappers for plugin-owned native terminal create/show/close,
From version 0.2.0, the SDK includes wrappers for plugin-owned native terminal create/show/close,
reopen with bounded display history, disposal and exit subscriptions. These
methods are discovered within protocol 3; they require a newer host and
`terminal.create`, not a new protocol version. See
Expand Down
Loading