Files
openidea/crates/ide-plugin/src/lib.rs
T
DeH40andDeH40 d21a4ca9d9 feat(plugins): custom Search Everywhere categories (API 1.13) (#3974)
Plugins can add their own tabs to the double-Shift search dialog: `[[contributes.searchCategories]]` declares a stable id and a title, and the optional `search-provider` export (SDK `search::SearchProvider`) answers the category's queries. Queries keep their raw text (at most 1024 bytes, 1–200 results), are cancellable and time-boxed, and run without prompts. Results open a validated location in the current project or run one of the plugin's own declared commands. Custom tabs stay out of All, so endpoint search and the other tabs are unchanged; disabling, uninstalling or reloading the plugin withdraws its tabs. Plugin API 1.13 (WIT, engine and SDK versions, docs); `plugin_search` is a cancellable command. Every plugin component is rebuilt.

Closes #3966

Co-authored-by: DeH40 <26625570+DeH40@users.noreply.github.com>
2026-11-19 04:48:15 +08:00

37 lines
1.3 KiB
Rust

//! The WebAssembly runtime for plugins (wasmtime, component model, WASI
//! preview 2). Package handling, extension points and grants live in
//! `ide-extension`; the host that assembles them is `ide-host::plugins`.
//!
//! Each plugin with code runs in its own wasmtime `Store`: no files, env or
//! network beyond what [`HostApi`] grants, a fuel budget and wall-clock
//! deadline per call, and a linear-memory cap. A trap (panic, budget
//! exhausted, permission violation, cancellation) poisons the instance; the
//! host drops it. Each active plugin's runtime lives on its own [`Actor`] thread.
mod actor;
pub mod indexing;
mod runtime;
mod sandbox;
pub mod search;
mod types;
mod wit_host;
pub use actor::{Actor, ActorError, Pending};
pub use runtime::{
API_VERSION, CANCELLED, CallCancel, CallError, GuestError, HostApi, MAX_CLIPBOARD_BYTES, PluginEngine, Runtime,
RuntimeSetup, check_api, component_api, host_api,
};
pub use sandbox::{
MAX_READ_BYTES, inside_root, inside_roots, read_text, resolve_in_root, resolve_in_roots, resolve_new_in_root,
resolve_new_in_roots, resolve_real, resolve_writable_in_root, resolve_writable_in_roots,
};
pub use types::*;
pub use wasmtime::component::Component;
mod execution;
pub use execution::*;
pub use ide_core::remote_settings::PluginRunTarget;
pub mod language_features;