Rename

Refactoring with Rename is useful when the existing name of a symbol is ambiguous, misleading or otherwise fails to convey proper meaning. Rename changes the definition and all references, and declaration when programming in C/C++, C# and VB. Rename optionally changes comments and strings. Rename applies the change throughout your solution.

You can rename methods, fields, classes, variables and method parameters.

In the following example, Rename is used to replace Circumference with Perimeter.



After hovering over temp and invoking Rename from the refactoring menu, enter the new name for the symbol. All references which Visual Assist X intends to rename also appear in the dialog.



Press Rename and your refactoring is complete.


Rename after Change to Definition

If you rename a symbol manually in its definition, references to the original symbol become unknown. Visual Assist X recognizes when you are renaming a symbol and offers a menu so you can rename instantly or rename after previewing the changes.

Rename Dialog

Double click an entry in the Rename dialog to highlight it in your source. Visual Assist X opens the file containing the reference if it is not already open, but the file is not displayed with
Enhanced Syntax Coloring until it receives focus after the Rename.

Uncheck the box to the left of an entry to prevent it from being renamed. Uncheck the box to the left of a file to prevent all references in the file from being renamed.



Multiple references on a single line appear in multiple entries. References to your symbol are highlighted to make the entries more visible.


Miscellaneous

You can invoke Rename from a definition, reference or declaration of a symbol.

Rename will modify symbols within comments when the 'Comments and Strings' box is checked.

Rename in a base class changes overriding names in derived classes. Rename of a overriding member in a derived class does not rename within a base class.

Change Signature is an enhanced version of rename for modifying a method or parameter.

Use UNDO to revert changes made to all files by Rename. (One UNDO reverts all changes when using VS2005 or VS.NET. Multiple UNDOs required when using VC++ 6.0.)

Rename is available for symbols found in stable directories but the refactoring changes only references within your project. The headers within the stable directories, e.g. MFC, 3rd party SDKs and class libraries, are untouched.