apply_code_action
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.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | ✓ | Full path to the C# source file |
line | int | ✓ | Line number (1-based) |
column | int | ✓ | Column number (1-based) |
actionTitle | string | ✓ | Exact title of the code action to apply (from get_code_actions) |
endLine | int? | End line for text selection (1-based, optional) | |
endColumn | int? | End column for text selection (1-based, optional) | |
preview | bool | Preview only — return diff without writing to disk (default: true) |