CodeActionProvider

Trait CodeActionProvider 

Source
pub trait CodeActionProvider {
    // Required methods
    fn id(&self) -> SharedString;
    fn code_actions(
        &self,
        state: Entity<InputState>,
        range: Range<usize>,
        window: &mut Window,
        cx: &mut App,
    ) -> Task<Result<Vec<CodeAction>>>;
    fn perform_code_action(
        &self,
        state: Entity<InputState>,
        action: CodeAction,
        push_to_history: bool,
        window: &mut Window,
        cx: &mut App,
    ) -> Task<Result<()>>;
}

Required Methods§

Source

fn id(&self) -> SharedString

The id for this CodeAction.

Source

fn code_actions( &self, state: Entity<InputState>, range: Range<usize>, window: &mut Window, cx: &mut App, ) -> Task<Result<Vec<CodeAction>>>

Fetches code actions for the specified range.

textDocument/codeAction

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeAction

Source

fn perform_code_action( &self, state: Entity<InputState>, action: CodeAction, push_to_history: bool, window: &mut Window, cx: &mut App, ) -> Task<Result<()>>

Performs the specified code action.

Implementors§