дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 17:47:08 +02:00
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 <[email protected]>
21 рядки
492 B
Rust
21 рядки
492 B
Rust
//! Results returned by a plugin's optional Search Everywhere provider.
|
|
use crate::Location;
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub enum SearchTarget {
|
|
Location(Location),
|
|
Command { id: String, arg: Option<String> },
|
|
}
|
|
#[derive(Clone, Debug)]
|
|
pub struct SearchItem {
|
|
pub id: String,
|
|
pub title: String,
|
|
pub description: Option<String>,
|
|
pub target: SearchTarget,
|
|
}
|
|
#[derive(Clone, Debug, Default)]
|
|
pub struct SearchPage {
|
|
pub items: Vec<SearchItem>,
|
|
pub has_more: bool,
|
|
}
|