Файли
openidea/wit/search.wit
T
Charlie.Weiтаcharli117 bf2478934e feat(plugins): deliver caret-moved events (API 1.15) (#5119)
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 <[email protected]>
2026-11-22 10:43:27 +08:00

35 рядки
1.2 KiB
Plaintext
Неформатований Анотація Історія

Цей файл містить неоднозначні символи Юнікоду
Цей файл містить символи Юнікоду, які можна сплутати з іншими символами. Якщо ви вважаєте, що це зроблено навмисно, можете сміливо ігнорувати це попередження. Щоб показати їх, скористайтеся кнопкою Escape.
package openidea:[email protected];
/// On-demand results for `[[contributes.searchCategories]]`. Optional, API 1.13.
interface search-provider {
use types.{error, location};
use invocation.{invocation};
record search-command {
/// A command declared by this plugin, without the host's prefix.
id: string,
arg: option<string>,
}
variant search-target {
/// A valid UTF-16 range inside the current project.
location(location),
command(search-command),
}
record search-item {
/// Stable within this plugin's category and query results.
id: string,
title: string,
description: option<string>,
target: search-target,
}
record search-page {
items: list<search-item>,
has-more: bool,
}
/// The category's local manifest id, raw query (at most 1024 UTF-8 bytes),
/// and requested maximum (1–200). Preserve ranking in the returned list.
/// Empty queries may return initial suggestions. This is a background call:
/// no prompts or implicit commands. Superseded queries are cancelled by the host.
search: func(category: string, query: string, limit: u32, ctx: borrow<invocation>) -> result<search-page, error>;
}