pub struct GenericCodeActionsEngine { /* private fields */ }Expand description
Generic code actions engine that delegates to pluggable providers
Implementations§
Source§impl GenericCodeActionsEngine
impl GenericCodeActionsEngine
Sourcepub fn register_provider(&mut self, provider: Box<dyn CodeActionProvider>)
pub fn register_provider(&mut self, provider: Box<dyn CodeActionProvider>)
Register a code action provider
Sourcepub fn registry(&self) -> &CodeActionRegistry
pub fn registry(&self) -> &CodeActionRegistry
Get the provider registry
Sourcepub fn registry_mut(&mut self) -> &mut CodeActionRegistry
pub fn registry_mut(&mut self) -> &mut CodeActionRegistry
Get a mutable reference to the provider registry
Sourcepub fn suggest_actions(
&self,
diagnostic: &Diagnostic,
code: &str,
language: &str,
) -> ProviderResult<Vec<String>>
pub fn suggest_actions( &self, diagnostic: &Diagnostic, code: &str, language: &str, ) -> ProviderResult<Vec<String>>
Suggest code actions using the appropriate provider or fallback
Sourcepub fn apply_action(
&self,
code: &str,
action: &str,
language: &str,
) -> ProviderResult<String>
pub fn apply_action( &self, code: &str, action: &str, language: &str, ) -> ProviderResult<String>
Apply a code action using the appropriate provider or fallback
Sourcepub fn has_provider(&self, language: &str) -> bool
pub fn has_provider(&self, language: &str) -> bool
Check if a provider is registered for a language
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GenericCodeActionsEngine
impl !RefUnwindSafe for GenericCodeActionsEngine
impl Send for GenericCodeActionsEngine
impl Sync for GenericCodeActionsEngine
impl Unpin for GenericCodeActionsEngine
impl !UnwindSafe for GenericCodeActionsEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more