roslyn:apply_code_action_by_title
Apply a specific code action, such as refactoring or fix, by its title at a given position in a C# file. Supports exact or partial title matching and works with zero-based coordinates.
Instructions
Apply a code action by its title. Supports exact and partial matching.
USAGE: apply_code_action_by_title(filePath, line, column, title) OUTPUT: Changed files with preview or applied changes WORKFLOW: (1) Call get_code_actions_at_position first, (2) Apply with preview=true, (3) Apply with preview=false IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Zero-based line number | |
| title | Yes | Action title (exact or partial match) | |
| column | Yes | Zero-based column number | |
| endLine | No | Optional: end line for selection | |
| preview | No | Preview mode (default: true). Set to false to apply. | |
| filePath | Yes | Absolute path to source file | |
| endColumn | No | Optional: end column for selection |