A CodeAction must set either edit and/or a command.
If both are supplied, the edit is applied first, then the command is executed.
| Modifier and Type | Field and Description |
|---|---|
| private Command | command
A command this code action executes. |
| private Object | data
A data entry field that is preserved on a code action between a `textDocument/codeAction` and a `codeAction/resolve` request. |
| private List | diagnostics
The diagnostics that this code action resolves. |
| private CodeActionDisabled | disabled
Marks that the code action cannot currently be applied. |
| private WorkspaceEdit | edit
The workspace edit this code action performs. |
| private Boolean | isPreferred
Marks this as a preferred action. |
| private String | kind
The kind of the code action. |
| private String | title
A short, human-readable, title for this code action. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(final Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public Command | |
| public Object | getData()
A data entry field that is preserved on a code action between a `textDocument/codeAction` and a `codeAction/resolve` request. |
| public List | |
| public CodeActionDisabled | |
| public WorkspaceEdit | |
| public Boolean | |
| public String | |
| public String | |
| public int | |
| public void | |
| public void | |
| public void | |
| public void | setDisabled(final CodeActionDisabled disabled)
Marks that the code action cannot currently be applied. |
| public void | |
| public void | |
| public void | |
| public void | |
| public String |
| command | back to summary |
|---|---|
| private Command 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. | |
| data | back to summary |
|---|---|
| private Object data A data entry field that is preserved on a code action between a `textDocument/codeAction` and a `codeAction/resolve` request. Since 3.16.0 | |
| diagnostics | back to summary |
|---|---|
| private List<Diagnostic> diagnostics The diagnostics that this code action resolves. | |
| disabled | back to summary |
|---|---|
| private CodeActionDisabled disabled Marks that the code action cannot currently be applied. Clients should follow the following guidelines regarding disabled code actions:
Since 3.16.0 | |
| edit | back to summary |
|---|---|
| private WorkspaceEdit edit The workspace edit this code action performs. | |
| isPreferred | back to summary |
|---|---|
| private Boolean isPreferred 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 | |
| kind | back to summary |
|---|---|
| private String kind The kind of the code action. Used to filter code actions.
See | |
| title | back to summary |
|---|---|
| private String title A short, human-readable, title for this code action. | |
| CodeAction | back to summary |
|---|---|
| public CodeAction() | |
| CodeAction | back to summary |
|---|---|
| public CodeAction(final String title) | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getCommand | back to summary |
|---|---|
| public Command 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. | |
| getData | back to summary |
|---|---|
| public Object getData() A data entry field that is preserved on a code action between a `textDocument/codeAction` and a `codeAction/resolve` request. Since 3.16.0 | |
| getDiagnostics | back to summary |
|---|---|
| public List The diagnostics that this code action resolves. | |
| getDisabled | back to summary |
|---|---|
| public CodeActionDisabled getDisabled() Marks that the code action cannot currently be applied. Clients should follow the following guidelines regarding disabled code actions:
Since 3.16.0 | |
| getEdit | back to summary |
|---|---|
| public WorkspaceEdit getEdit() The workspace edit this code action performs. | |
| getIsPreferred | back to summary |
|---|---|
| public Boolean 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 | |
| getKind | back to summary |
|---|---|
| public String getKind() The kind of the code action. Used to filter code actions.
See | |
| getTitle | back to summary |
|---|---|
| public String getTitle() A short, human-readable, title for this code action.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| setCommand | back to summary |
|---|---|
| public void setCommand(final Command 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. | |
| setData | back to summary |
|---|---|
| public void setData(final Object data) A data entry field that is preserved on a code action between a `textDocument/codeAction` and a `codeAction/resolve` request. Since 3.16.0 | |
| setDiagnostics | back to summary |
|---|---|
| public void setDiagnostics(final List<Diagnostic> diagnostics) The diagnostics that this code action resolves. | |
| setDisabled | back to summary |
|---|---|
| public void setDisabled(final CodeActionDisabled disabled) Marks that the code action cannot currently be applied. Clients should follow the following guidelines regarding disabled code actions:
Since 3.16.0 | |
| setEdit | back to summary |
|---|---|
| public void setEdit(final WorkspaceEdit edit) The workspace edit this code action performs. | |
| setIsPreferred | back to summary |
|---|---|
| public void setIsPreferred(final Boolean isPreferred) 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 | |
| setKind | back to summary |
|---|---|
| public void setKind(final String kind) The kind of the code action. Used to filter code actions.
See | |
| setTitle | back to summary |
|---|---|
| public void setTitle(final String title) A short, human-readable, title for this code action. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |