Code Action Feature
Opened this issue · 0 comments
DotJoshJohnson commented
Code Action
The code action request is sent from the client to the server to compute commands for a given text document and range. The request is trigger when the user moves the cursor into an problem marker in the editor or presses the lightbulb associated with a marker.
Request
- method: 'textDocument/codeAction'
- param:
CodeActionParams
defined as follows:
/**
* Params for the CodeActionRequest
*/
interface CodeActionParams {
/**
* The document in which the command was invoked.
*/
textDocument: TextDocumentIdentifier;
/**
* The range for which the command was invoked.
*/
range: Range;
/**
* Context carrying additional information.
*/
context: CodeActionContext;
}
/**
* Contains additional diagnostic information about the context in which
* a code action is run.
*/
interface CodeActionContext {
/**
* An array of diagnostics.
*/
diagnostics: Diagnostic[];
}
Response
- result:
Command[]
defined as follows: Nothing in official docs here! - error: code and message set in case an exception happens during the code action request.