Skip to main content

rename_symbol

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.

Parameters

ParameterTypeRequiredDescription
symbolstringSymbol to rename: simple type (MyClass), fully qualified (Namespace.MyClass), or member (MyClass.MyMethod)
newNamestringNew name — a bare C# identifier, e.g. 'OrderProcessor'
renameOverloadsboolRename all overloads of a method together (default: true; false renames a single arbitrary overload)
renameInStringsboolAlso rewrite occurrences inside string literals (default: false)
renameInCommentsboolAlso rewrite occurrences inside comments (default: true)
previewboolPreview only — return edits without writing to disk (default: true)
forceboolApply even when Conflicts are reported (default: false)