The kind of a code action.
Kinds are a hierarchical list of identifiers separated by .,
e.g. "refactor.extract.function".
The set of kinds is open and client needs to announce the kinds it supports to the server during initialization. You can make your own code action kinds, the ones supported by LSP are:
quickfixrefactorrefactor.extractrefactor.inlinerefactor.rewrite
sourceSource code actions apply to the entire file. Eg fixing all issues or organising imports.source.organizeImportssource.fixAll
Equations
- invoked: Lean.Lsp.CodeActionTriggerKind
Code actions were explicitly requested by the user or by an extension.
- automatic: Lean.Lsp.CodeActionTriggerKind
Code actions were requested automatically.
This typically happens when current selection in a file changes, but can also be triggered when file content changes.
Instances For
Equations
- Lean.Lsp.instToJsonCodeActionTriggerKind = { toJson := fun x => match x with | Lean.Lsp.CodeActionTriggerKind.invoked => 1 | Lean.Lsp.CodeActionTriggerKind.automatic => 2 }
Equations
- One or more equations did not get rendered due to their size.
An array of diagnostics known on the client side overlapping the range provided to the
textDocument/codeActionrequest. They are provided so that the server knows which errors are currently presented to the user for the given range. There is no guarantee that these accurately reflect the error state of the resource. The primary parameter to compute code actions is the provided range.diagnostics : Array Lean.Lsp.DiagnosticRequested kind of actions to return.
Actions not of this kind are filtered out by the client before being shown. So servers can omit computing them.
only? : Option (Array Lean.Lsp.CodeActionKind)The reason why code actions were requested.
triggerKind? : Option Lean.Lsp.CodeActionTriggerKind
Contains additional diagnostic information about the context in which a code action is run.
Instances For
Equations
- Lean.Lsp.instFromJsonCodeActionContext = { fromJson? := Lean.Lsp.fromJsonCodeActionContext✝ }
- textDocument : Lean.Lsp.TextDocumentIdentifier
- range : Lean.Lsp.Range
- context : Lean.Lsp.CodeActionContext
Parameters for a CodeActionRequest.
Instances For
Equations
- Lean.Lsp.instFromJsonCodeActionParams = { fromJson? := Lean.Lsp.fromJsonCodeActionParams✝ }
Equations
CodeActionKinds that this server may return.
The list of kinds may be generic, such as
"refactor", or the server may list out every specific kind they provide.codeActionKinds? : Option (Array Lean.Lsp.CodeActionKind)The server provides support to resolve additional information for a code action.
Capabilities of the server for handling code actions.
Instances For
Equations
- Lean.Lsp.instFromJsonCodeActionOptions = { fromJson? := Lean.Lsp.fromJsonCodeActionOptions✝ }
Equations
- Lean.Lsp.instFromJsonCodeActionData = { fromJson? := Lean.Lsp.fromJsonCodeActionData✝ }
Equations
- Lean.Lsp.instToJsonCodeActionData = { toJson := Lean.Lsp.toJsonCodeActionData✝ }
A short, human-readable, title for this code action.
title : StringThe kind of the code action.
kind? : Option Lean.Lsp.CodeActionKindThe diagnostics that this code action resolves.
diagnostics? : Option (Array Lean.Lsp.Diagnostic)Marks this as a preferred action. Preferred actions are used by the
auto fixcommand and can be targeted by keybindings.Marks that the code action cannot currently be applied.
disabled? : Option Lean.Lsp.CodeActionDisabledThe workspace edit this code action performs.
edit? : Option Lean.Lsp.WorkspaceEditA command this code action executes.
If a code action provides an edit and a command, first the edit is executed and then the command.
command? : Option Lean.Lsp.CommandA data entry field that is preserved on a code action between a
textDocument/codeActionand acodeAction/resolverequest. In particular, for Lean-created commands we expectdatato have auri : DocumentUrifield so thatFileSourcecan be implemented.data? : Option Lean.Lsp.CodeActionData
A code action represents a change that can be performed in code, e.g. to fix a problem or to refactor code.
A CodeAction should set either edit and/or a command.
If both are supplied, the edit is applied first, then the command is executed.
If none are supplied, the client makes a codeAction/resolve JSON-RPC request to compute the edit.
Instances For
Equations
- Lean.Lsp.instToJsonCodeAction = { toJson := Lean.Lsp.toJsonCodeAction✝ }
Equations
- Lean.Lsp.instFromJsonCodeAction = { fromJson? := Lean.Lsp.fromJsonCodeAction✝ }
Equations
- Lean.Lsp.instFromJsonResolveSupport = { fromJson? := Lean.Lsp.fromJsonResolveSupport✝ }
Equations
- Lean.Lsp.instToJsonResolveSupport = { toJson := Lean.Lsp.toJsonResolveSupport✝ }
The code action kind values the client supports. When this property exists the client also guarantees that it will handle values outside its set gracefully and falls back to a default value when unknown.
valueSet : Array Lean.Lsp.CodeActionKind
Instances For
The code action kind is supported with the following value set.
codeActionKind : Lean.Lsp.CodeActionLiteralSupportValueSet
Instances For
Whether we can register capabilities dynamically.
Whether the code action supports the
isPreferredproperty.Whether the code action supports the
disabledproperty.Weather code action supports the
dataproperty which is preserved between atextDocument/codeActionand acodeAction/resolverequest.Whether the client honors the change annotations in text edits and resource operations returned via the
CodeAction#editproperty by for example presenting the workspace edit in the user interface and asking for confirmation.The client supports code action literals as a valid response of the
textDocument/codeActionrequest.codeActionLiteralSupport? : Option Lean.Lsp.CodeActionLiteralSupportWhether the client supports resolving additional code action properties via a separate
codeAction/resolverequest.resolveSupport? : Option Lean.Lsp.ResolveSupport