List or apply a code action
nvim_code_actionsList available LSP code actions at a given position, then apply a selected fix and save the file. Resolve diagnostics quickly by retrieving and applying quick fixes directly.
Instructions
List LSP code actions at a position. Pass apply_index to apply one and save the file. Use this to apply quick fixes for diagnostics.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"line": "<line>",
"column": "<column>"
},
"name": "nvim_code_actions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number, 1-based | |
| path | Yes | File path | |
| column | Yes | Column number, 1-based | |
| wait_ms | No | LSP timeout | |
| apply_index | No | Index from a previous list call; omit to only list |