lsp_code_actions
Retrieve and apply code actions like quick fixes, refactoring operations, and import organization at specific positions in source files to automate code improvements.
Instructions
Get available code actions (refactorings, quick fixes) at a position or range. Use for automated fixes, imports organization, and refactoring operations.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the source file | |
| start_line | Yes | Start line number (1-indexed) | |
| start_column | Yes | Start column number (1-indexed) | |
| end_line | No | End line number (1-indexed). Defaults to start line. | |
| end_column | No | End column number (1-indexed). Defaults to start column. | |
| kinds | No | Filter by code action kinds: quickfix, refactor, refactor.extract, refactor.inline, refactor.rewrite, source, source.organizeImports, source.fixAll | |
| apply | No | If true, apply the first available action. If false, just list available actions. | |
| action_index | No | Index of the action to apply (when apply=true). Defaults to 0 (first action). |