pub trait QuickOpenProvider: Send + Sync {
// Required methods
fn prefix(&self) -> &str;
fn suggestions(
&self,
query: &str,
context: &QuickOpenContext,
) -> Vec<Suggestion>;
fn on_select(
&self,
suggestion: Option<&Suggestion>,
query: &str,
context: &QuickOpenContext,
) -> QuickOpenResult;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
}Expand description
Trait for quick open providers
Each provider handles a specific prefix and provides suggestions for that domain (files, commands, buffers, etc.)
Required Methods§
Sourcefn prefix(&self) -> &str
fn prefix(&self) -> &str
The prefix that triggers this provider (e.g., “>”, “#”, “:”) Empty string means this is the default provider (no prefix)
Sourcefn suggestions(
&self,
query: &str,
context: &QuickOpenContext,
) -> Vec<Suggestion>
fn suggestions( &self, query: &str, context: &QuickOpenContext, ) -> Vec<Suggestion>
Generate suggestions for the given query
The query has already had the prefix stripped.
Sourcefn on_select(
&self,
suggestion: Option<&Suggestion>,
query: &str,
context: &QuickOpenContext,
) -> QuickOpenResult
fn on_select( &self, suggestion: Option<&Suggestion>, query: &str, context: &QuickOpenContext, ) -> QuickOpenResult
Handle selection of a suggestion
suggestion is the currently selected suggestion (already resolved by the caller).
query is the original query (without prefix).
Sourcefn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Downcast support for concrete provider access (e.g., updating cache).
Sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Mutable downcast support, for re-pointing concrete provider state
(e.g. swapping the FileProvider’s filesystem + process spawner when
the active authority changes).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".