apply_code_action
Apply a code action (refactoring or fix) to a C# file by its title. Use preview mode to see the diff before writing changes to disk.
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) |