Struct lsp::types::CodeAction [−][src]
pub struct CodeAction { pub title: String, pub kind: Option<CodeActionKind>, pub diagnostics: Option<Vec<Diagnostic>>, pub edit: Option<WorkspaceEdit>, pub command: Option<Command>, }
A code action represents a change that can be performed in code, e.g. to fix a problem or to refactor code.
A CodeAction must set either edit
and/or a command
. If both are supplied, the edit
is applied first, then the command
is executed.
Fields
title: String
A short, human-readable, title for this code action.
kind: Option<CodeActionKind>
The kind of the code action.
Used to filter code actions.
diagnostics: Option<Vec<Diagnostic>>
The diagnostics that this code action resolves.
edit: Option<WorkspaceEdit>
The workspace edit this code action performs.
command: Option<Command>
A command this code action executes. If a code action provides a edit and a command, first the edit is executed and then the command.
Methods
impl CodeAction
[src]
impl CodeAction
pub fn create_with_command(
title: String,
command: Command,
kind: Option<CodeActionKind>
) -> Self
[src]
pub fn create_with_command(
title: String,
command: Command,
kind: Option<CodeActionKind>
) -> Self
Creates a new code action.
@param title The title of the code action. @param command The command to execute. @param kind The kind of the code action.
pub fn create_with_workspace_edit(
title: String,
edit: WorkspaceEdit,
kind: Option<CodeActionKind>
) -> Self
[src]
pub fn create_with_workspace_edit(
title: String,
edit: WorkspaceEdit,
kind: Option<CodeActionKind>
) -> Self
Creates a new code action.
@param title The title of the code action. @param command The command to execute. @param kind The kind of the code action.
Trait Implementations
impl Debug for CodeAction
[src]
impl Debug for CodeAction
Auto Trait Implementations
impl Send for CodeAction
impl Send for CodeAction
impl Sync for CodeAction
impl Sync for CodeAction