nvim_runtime_lua

lsp.CodeAction

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.

@since 3.15.0 @since 3.16.0 @since 3.16.0 @since 3.18.0 - proposed

Fields9

CodeAction.title : string

A short, human-readable, title for this code action.

CodeAction.kind : lsp.CodeActionKind | nil

The kind of the code action.

Used to filter code actions.

CodeAction.diagnostics : lsp.Diagnostic[] | nil

The diagnostics that this code action resolves.

CodeAction.isPreferred : nil | boolean
CodeAction.disabled : lsp.CodeActionDisabled | nil
CodeAction.edit : lsp.WorkspaceEdit | nil

The workspace edit this code action performs.

CodeAction.command : lsp.Command | nil

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.

CodeAction.data : lsp.LSPAny | nil
CodeAction.tags : lsp.CodeActionTag[] | nil