mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 16:04:21 +00:00
Plugin API 1.15 adds a caret-moved event through the existing events.other channel (no WIT interface or signature change): {path, line, col, settled} with 0-based UTF-16 positions for the focused editor. The frontend batches caret moves after 120 ms (only the latest position per file) and sends one settled event 600 ms after the caret rests; queued and delayed events are dropped when the editor, document, path or project changes. editor-focused now carries the focused editor (path, language, selections) through an optional argument on plugin_set_active_file, which the remote adapter forwards. Requires the events capability; components and fixtures are rebuilt for 1.15.
Co-authored-by: charli117 <24435100+charli117@users.noreply.github.com>
32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
package openidea:plugin@1.15.0;
|
|
|
|
/// Optional export (world `plugin-semantic-tokens`): semantic colouring of
|
|
/// documents of the languages declared with the `semantic-tokens` provider
|
|
/// kind, including languages the plugin doesn't contribute. The tokens join
|
|
/// the language server's and win where they overlap one.
|
|
interface semantic-tokens-provider {
|
|
use types.{range};
|
|
|
|
/// The document to colour (the editor's text while it is open).
|
|
record document {
|
|
/// Absolute path.
|
|
path: string,
|
|
language: string,
|
|
version: u64,
|
|
text: string,
|
|
}
|
|
|
|
/// A token: part of one line.
|
|
record semantic-token {
|
|
range: range,
|
|
/// An LSP token type in kebab-case (`method`, `property`, `type`, …).
|
|
kind: string,
|
|
/// LSP token modifiers in kebab-case (`static`, `deprecated`, …).
|
|
modifiers: list<string>,
|
|
}
|
|
|
|
/// The document's tokens, at most 65,536; asked again after each edit,
|
|
/// under the edit-path budget.
|
|
semantic-tokens: func(doc: document) -> list<semantic-token>;
|
|
}
|