Файли
openidea/sdk/rust/openidea-plugin/tests/api/released/completion-resolve.wit
T

56 рядки
1.8 KiB
Plaintext

package openidea:[email protected];
/// Optional export (API 1.21, world `plugin-completion-resolve`): completion items
/// carrying an opaque `data` token resolved lazily via `resolve` on selection.
interface completion-resolve-provider {
use types.{error, position, range, text-edit};
/// The document a request is about (matching `providers.document`).
record document {
path: string,
language: string,
version: u64,
text: string,
}
/// A completion item (matching `providers.completion-item`).
record completion-item {
label: string,
detail: option<string>,
kind: option<string>,
insert-text: string,
snippet: bool,
replace: option<range>,
sort-text: option<string>,
filter-text: option<string>,
documentation: option<string>,
additional-edits: list<text-edit>,
}
record completion-item-ref {
item: completion-item,
/// Opaque reference passed back to `resolve` once this item is focused.
data: option<string>,
}
record resolvable-completion-list {
items: list<completion-item-ref>,
/// Same semantics as `completion-list-provider.completion-list.incomplete`.
incomplete: bool,
}
completion: func(doc: document, at: position, trigger: option<string>) -> resolvable-completion-list;
resolve: func(doc: document, item: completion-item-ref) -> result<completion-item, error>;
}
/// The optional export-only world the SDK merges with `plugin`.
world completion-resolve-exports {
export completion-resolve-provider;
}
/// The host-side world used to instantiate a component that exports it.
world plugin-completion-resolve {
include plugin;
export completion-resolve-provider;
}