Файли
openidea/sdk/rust/openidea-plugin/wit/providers.wit
T
l0ng-ai fd1f465aeb feat(plugins): extension points, capability consent, async runtime and plugin API 1.0
Rework the plugin system per docs/plugin_plan.md (P0–P8):

- Extension-point registry (ide-extension) so new contribution types register
  without touching the kernel; languages, run detectors, providers, views and
  UI contributions go through it.
- Per-plugin capability consent with a risk-graded ledger; process
  capabilities are pinned to resolved binary paths and hashes.
- Async, actor-per-plugin Wasm runtime with lazy activation, cancellation,
  events, long-running tasks and idle reclamation.
- Plugin host moved into ide-host, shared by local and remote projects.
- Distribution: install/package tooling (openidea-plugin bin) and a static
  market index.
- WIT frozen as openidea:[email protected]; Rust SDK with mock host.
- Ten official validation plugins under plugins/official.
2026-11-04 02:41:46 +08:00

84 рядки
2.4 KiB
Plaintext

package openidea:[email protected];
/// Editor features a plugin provides for the languages it declares under
/// `[[contributes.providers]]` (the host calls only declared kinds). They run
/// on the editing path: a result later than ~50 ms is dropped, a call still
/// running at 500 ms is interrupted.
interface providers {
use types.{position, range, text-edit, location};
/// The document a request is about.
record document {
path: string,
language: string,
version: u64,
text: string,
}
enum completion-kind {
text,
method,
function,
%constructor,
field,
variable,
class,
%interface,
module,
property,
keyword,
snippet,
value,
constant,
file,
reference,
}
record completion-item {
label: string,
detail: option<string>,
kind: option<completion-kind>,
insert-text: string,
/// Replaced on accept; `none`: the word at the caret.
replace: option<range>,
sort-text: option<string>,
documentation: option<string>,
}
record inline-suggestion {
insert-text: string,
/// Replaced range; `none` inserts at the caret.
replace: option<range>,
}
record file-edit {
path: string,
edits: list<text-edit>,
}
record code-action {
title: string,
/// `quickfix`, `refactor`, …
kind: option<string>,
preferred: bool,
edits: list<file-edit>,
}
record line-marker {
line: u32,
/// Gutter icon: `navigate` (default), `implemented`, `implementing`, `run`.
icon: option<string>,
tooltip: string,
/// Opened on click.
target: option<location>,
}
completion: func(doc: document, at: position, trigger: option<string>) -> list<completion-item>;
/// Ghost text at the caret (typing replaces an older request: it is cancelled).
inline-completion: func(doc: document, at: position) -> option<inline-suggestion>;
/// Actions for `selection` (quick fixes for the plugin's own diagnostics).
code-actions: func(doc: document, selection: range) -> list<code-action>;
definition: func(doc: document, at: position) -> list<location>;
line-markers: func(doc: document) -> list<line-marker>;
}