Struct lsp2::CodeAction
pub struct CodeAction {
pub title: String,
pub kind: Option<CodeActionKind>,
pub diagnostics: Option<Vec<Diagnostic, Global>>,
pub edit: Option<WorkspaceEdit>,
pub command: Option<Command>,
pub is_preferred: Option<bool>,
pub disabled: Option<CodeActionDisabled>,
pub data: Option<Value>,
}
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, Global>>
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 an edit and a command, first the edit is executed and then the command.
is_preferred: Option<bool>
Marks this as a preferred action. Preferred actions are used by the auto fix
command and can be targeted
by keybindings.
A quick fix should be marked preferred if it properly addresses the underlying error.
A refactoring should be marked preferred if it is the most reasonable choice of actions to take.
@since 3.15.0
disabled: Option<CodeActionDisabled>
Marks that the code action cannot currently be applied.
Clients should follow the following guidelines regarding disabled code actions:
-
Disabled code actions are not shown in automatic lightbulb code action menu.
-
Disabled actions are shown as faded out in the code action menu when the user request a more specific type of code action, such as refactorings.
-
If the user has a keybinding that auto applies a code action and only a disabled code actions are returned, the client should show the user an error message with
reason
in the editor.
@since 3.16.0
data: Option<Value>
A data entry field that is preserved on a code action between
a textDocument/codeAction
and a codeAction/resolve
request.
@since 3.16.0
Trait Implementations§
§impl Clone for CodeAction
impl Clone for CodeAction
§fn clone(&self) -> CodeAction
fn clone(&self) -> CodeAction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for CodeAction
impl Debug for CodeAction
§impl Default for CodeAction
impl Default for CodeAction
§fn default() -> CodeAction
fn default() -> CodeAction
§impl<'de> Deserialize<'de> for CodeAction
impl<'de> Deserialize<'de> for CodeAction
§fn deserialize<__D>(
__deserializer: __D
) -> Result<CodeAction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<CodeAction, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
§impl From<CodeAction> for CodeActionOrCommand
impl From<CodeAction> for CodeActionOrCommand
§fn from(action: CodeAction) -> CodeActionOrCommand
fn from(action: CodeAction) -> CodeActionOrCommand
§impl PartialEq<CodeAction> for CodeAction
impl PartialEq<CodeAction> for CodeAction
§fn eq(&self, other: &CodeAction) -> bool
fn eq(&self, other: &CodeAction) -> bool
self
and other
values to be equal, and is used
by ==
.