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§
Sourcefn id(&self) -> SharedString
fn id(&self) -> SharedString
The id for this CodeAction.
Sourcefn code_actions(
&self,
state: Entity<InputState>,
range: Range<usize>,
window: &mut Window,
cx: &mut App,
) -> Task<Result<Vec<CodeAction>>>
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
Sourcefn perform_code_action(
&self,
state: Entity<InputState>,
action: CodeAction,
push_to_history: bool,
window: &mut Window,
cx: &mut App,
) -> Task<Result<()>>
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.