Class CodeAction
java.lang.Object
org.graalvm.tools.lsp.server.types.JSONBase
org.graalvm.tools.lsp.server.types.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.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CodeActioncreate(String title, Object commandOrEdit, CodeActionKind kind) static CodeActioncreate(String title, Command command, CodeActionKind kind) Creates a new code action.static CodeActioncreate(String title, WorkspaceEdit edit, CodeActionKind kind) Creates a new code action.booleanA command this code action executes.The diagnostics that this code action resolves.getEdit()The workspace edit this code action performs.Marks this as a preferred action.getKind()The kind of the code action.getTitle()A short, human-readable, title for this code action.inthashCode()setCommand(Command command) setDiagnostics(List<Diagnostic> diagnostics) setEdit(WorkspaceEdit edit) setIsPreferred(Boolean isPreferred) setKind(CodeActionKind kind)
-
Method Details
-
getTitle
A short, human-readable, title for this code action. -
setTitle
-
getKind
The kind of the code action. Used to filter code actions. -
setKind
-
getDiagnostics
The diagnostics that this code action resolves. -
setDiagnostics
-
getIsPreferred
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
-
setIsPreferred
-
getEdit
The workspace edit this code action performs. -
setEdit
-
getCommand
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. -
setCommand
-
equals
-
hashCode
public int hashCode() -
create
Creates a new code action.- Parameters:
title- The title of the code action.command- The command to execute.kind- The kind of the code action.
-
create
Creates a new code action.- Parameters:
title- The title of the code action.edit- The workspace edit to perform.kind- The kind of the code action.
-
create
-