This refactoring allows you to change name of any symbol or project in your solution. All references to and usages of the symbol will be updated automatically.
Use the refactoring for different C# entities
Here is the list of entities that you can rename with this refactoring:
You will also be able to rename the project folder and the project's root namespace as well as all its usages in the solution.
You can also change its nesting level of the namespace. For example, you can rename namespace
If the renamed type is located in file with the same name, JetBrains Rider renames the containing file, too.
If the renamed type is a part of a hierarchy of types with similar names, for example
class Foo : IFoo, you will be able to choose whether to rename the related types.
If the method is a part of inheritance/implementation hierarchy, the related methods are renamed as well.
If the method has overloads, you will be able to choose whether to rename the overloads.
If the field is used in a property with a matching name, you will be able to choose whether to rename the property.
If the property has a backing field with a matching name, you will be able to rename the field as well.
If the method is a part of inheritance/implementation hierarchy, or has overloads with a parameter of the same name and type, you will be able to rename parameters in the related methods, too.
- Local variable
JetBrains Rider renames local variables without showing the dialog:
Invoke the refactoring with a command
Select an entity in one of the following ways:
In the editor, set the caret at the name of an entity.
Select an entity in the Solution Explorer.
Select an entity in the Structure window.
Do one of the following:
Press Ctrl+Alt+Shift+T and then choose Rename
Choosein the main menu.
The Rename dialog will open.
Type a new name for the entity or use one of the suggested names.
JetBrains Rider will suggest new names for the entity taking into account your naming style.
Depending on the entity that you rename, select which related items should be renamed, for example, occurrences of the entity in comments and string literals.
Click Next. If there are nothing related to the renamed entities, JetBrains Rider applies the refactoring. Otherwise, the wizard displays additional steps:
If there are related entities with similar names, they are listed on the following step:
Select related entities that you want to rename along with the selected entity - you can accept the suggested names or specify new names in the New Name column.
If you have previously selected Search in comments and string literals and occurrences of the entity name is found, they are listed on the following step: Select textual occurrences that you want JetBrains Rider to rename.
If no conflicts are found, JetBrains Rider performs the refactoring immediately. Otherwise, it prompts you to resolve conflicts.
Perform the refactoring in-place
You can rename an entity by modifying its declaration right in the editor and then applying a quick-fix to invoke the solution-wide refactoring.
As soon as you change entity's name at its declaration, a grey border appears around the name, notifying you that the refactoring is available. You can press Alt+Enter to find the refactoring in the action list: