Wiki

Case Status
Log In

Wiki

 
Whole Tomato Software - Home
  • RSS Feed

Rename Files

Change the name of your active document, and all related files, quickly and accurately using Rename Files. Visual Assist will update your project, solution, and files that refer to your renamed file. Additionally, a rename is propagated through source control systems that integrate with Visual Studio.

Access

Begin the rename by opening the context menu (Right-Click or Shift+F10) anywhere in the active document.

Select Rename Files, enter a new name, preview the files to be renamed or updated, and accept to complete the refactoring.

Rename to Class

If the caret is on a class name, you can begin Rename Files with the Quick Action and Refactoring menu (Shift+Alt+Q). Your class name will be the default destination name. (Rename Files is often run this way after renaming a class.)

Related Files

In C/C++, if you rename a header file, the corresponding source file will be renamed. And vice versa, rename of a source file changes the header file. Additionally, files that #include a renamed header file are modified to refer to the newly named header file.

In C#, design and code-behind files are renamed simultaneously. For example, rename of Myform.cs also renames MyForm.Designer.cs and MyForm.resx.

Destination

Renamed files remain in their existing directories. You cannot use Rename Files to move a file to a new directory.

Save and Undo

Files are saved before they are renamed.

Files are not saved after Rename Files, including files modified only to #include a newly named header file. Use the Save All command of the IDE to save after Rename Files.

You cannot undo Rename Files in a single step. (The exception is via separate command of a source code control system.) If you wish to revert a change, use Rename Files a second time to change names to their original, or yet another name.

Non-Project Files

You can rename files that are part of a disk-based project, open when no solution is open, or exclusive of an open solution. In these instances, Visual Assist will confirm your intent.

If your file is indeed part of a project or solution, you should rename when the project or solution is open so Visual Assist can update the project/solution files, as well as other files that might depend on your renamed files.

Universal Windows Application

Rename Files works across shared projects of a Universal Windows Application (UWA).

Visual Studio 2003 and older

Rename Files is not available.