CodeActionProvider

Trait CodeActionProvider 

Source
pub trait CodeActionProvider: Send + Sync {
    // Required methods
    fn language(&self) -> &str;
    fn suggest_actions(
        &self,
        diagnostic: &Diagnostic,
        code: &str,
    ) -> ProviderResult<Vec<String>>;
    fn apply_action(&self, code: &str, action: &str) -> ProviderResult<String>;
    fn config(&self) -> Option<&LanguageConfig>;
}
Expand description

Trait for language-specific code action providers

Required Methods§

Source

fn language(&self) -> &str

Get the language identifier this provider handles

Source

fn suggest_actions( &self, diagnostic: &Diagnostic, code: &str, ) -> ProviderResult<Vec<String>>

Suggest code actions for a diagnostic

Source

fn apply_action(&self, code: &str, action: &str) -> ProviderResult<String>

Apply a code action to code

Source

fn config(&self) -> Option<&LanguageConfig>

Get the configuration for this provider

Implementors§