дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 09:41:34 +02:00
Plugin API 1.21 adds the optional completion-resolve-provider export: completion returns items with an opaque data token, and resolve is called when the user focuses one. As with LSP completionItem/resolve, the resolved detail, documentation and additional edits are filled in while the label and what the item inserts stay as listed. Plugins without the export keep the existing completion providers. Includes the SDK trait and registration, a fixture plugin with a host integration test, rebuilt plugin components and README notes. Co-authored-by: RuyimgByCN <[email protected]>
35 рядки
1.2 KiB
Plaintext
35 рядки
1.2 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};
|
|
use providers.{document, completion-item};
|
|
|
|
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;
|
|
}
|