rename_symbol
Safely rename a type or member across the entire solution, cascading to references, constructors, overrides, and documentation. Preview changes before applying, with automatic conflict detection to avoid new compiler errors.
Instructions
Safely rename a type or member across the entire solution (Roslyn Renamer). Cascades to references, constructors, overrides, nameof, and XML doc crefs. Defaults to preview mode (returns edits without writing files); set preview=false to apply. New compiler errors the rename would introduce are reported as Conflicts, and apply mode refuses to write them unless force=true. Locals/parameters and file renames are not supported.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Apply even when Conflicts are reported (default: false) | |
| symbol | Yes | Symbol to rename: simple type (MyClass), fully qualified (Namespace.MyClass), or member (MyClass.MyMethod) | |
| newName | Yes | New name — a bare C# identifier, e.g. 'OrderProcessor' | |
| preview | No | Preview only — return edits without writing to disk (default: true) | |
| renameInStrings | No | Also rewrite occurrences inside string literals (default: false) | |
| renameOverloads | No | Rename all overloads of a method together (default: true; false renames a single arbitrary overload) | |
| renameInComments | No | Also rewrite occurrences inside comments (default: true) |