Structural search and replacement is your friend here. You get to it through ReSharper | Find | Search with Pattern... ReSharper | Find | Search with Pattern... ReSharper | Find | Search with Pattern...
- Define a placeholder of type
X , name it TX . - Make Your Search Template
$TX$ - Specify "Look in" "Project"
- As a check, do a search - you should see all the ways to use
X - Click "Replace Switch"
- Make the Replace template fully qualified with the name
Y - Click Replace
ReSharper will show you all the references to X that it wants to replace - check the box at the top of the tree, and then click Replace.
change
Indeed, using the template placeholder in our search template, make sure that only references to type X renamed, and not to everything called X
If you prefer to finish
using ABC; Y obObject = ...
but not
ABCY myObject
I think you can achieve this through:
- In
ReSharper | Options ReSharper | Options , Tools | Code Cleanup Tools | Code Cleanup define a new profile that has just โoptimizedโ using proven โdirectivesโ. - In
ReSharper | Options ReSharper | Options , Languages | C# | Namespace Imports Languages | C# | Namespace Imports Languages | C# | Namespace Imports add ABC to "Namespaces that should always be imported" - Launch
ReSharper | Tools | Cleanup Code ReSharper | Tools | Cleanup Code ReSharper | Tools | Cleanup Code using just defined profile. - Remove
ABC from the list of names you added to
although it will also clear everyone else using s, which may result in version control being a little more than you want.
Aakashm
source share