roslyn:apply_code_action_by_title
Apply Roslyn code actions by title to automate .NET/C# refactoring and code fixes. Use exact or partial title matching to implement compiler-accurate changes with preview capability.
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 |
|---|---|---|---|
| filePath | Yes | Absolute path to source file | |
| line | Yes | Zero-based line number | |
| column | Yes | Zero-based column number | |
| title | Yes | Action title (exact or partial match) | |
| endLine | No | Optional: end line for selection | |
| endColumn | No | Optional: end column for selection | |
| preview | No | Preview mode (default: true). Set to false to apply. |