apply_code_action
Apply a C# code action (refactoring or fix) by title, discovered via get_code_actions. Preview diff by default, or apply changes to disk with preview=false.
Instructions
Apply a code action (refactoring or fix) by its title. Use get_code_actions first to discover available actions. Defaults to preview mode (returns diff without writing files). Set preview=false to apply changes to disk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number (1-based) | |
| column | Yes | Column number (1-based) | |
| endLine | No | End line for text selection (1-based, optional) | |
| preview | No | Preview only — return diff without writing to disk (default: true) | |
| filePath | Yes | Full path to the C# source file | |
| endColumn | No | End column for text selection (1-based, optional) | |
| actionTitle | Yes | Exact title of the code action to apply (from get_code_actions) |