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§
Sourcefn suggest_actions(
&self,
diagnostic: &Diagnostic,
code: &str,
) -> ProviderResult<Vec<String>>
fn suggest_actions( &self, diagnostic: &Diagnostic, code: &str, ) -> ProviderResult<Vec<String>>
Suggest code actions for a diagnostic
Sourcefn apply_action(&self, code: &str, action: &str) -> ProviderResult<String>
fn apply_action(&self, code: &str, action: &str) -> ProviderResult<String>
Apply a code action to code
Sourcefn config(&self) -> Option<&LanguageConfig>
fn config(&self) -> Option<&LanguageConfig>
Get the configuration for this provider