roslyn:extract_variable
Extract a selected expression or cursor-positioned expression into a new local variable, simplifying refactoring in C# code.
Instructions
Extract an expression to a local variable.
USAGE: Position cursor on or select an expression. OUTPUT: Expression extracted to a new local variable. 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 | |
| endLine | No | Optional: end line for selection | |
| endColumn | No | Optional: end column for selection | |
| preview | No | Preview mode (default: true) |