简体   繁体   中英

How to remove redundant type qualifier solution wide?

Throughout our solution we have redundant type qualifiers like the following:

using Project.Folder;
...
Project.Folder.Enum enum = Project.Folder.Enum.Option;

I am looking for a way to find and remove all the Project.Folder. 's that are redundant (some won't be). Is there any tool other than Resharper that is capable of this mass refactoring?

Without being able to use resharper I would just ctrl + shift + h and replace with nothing and then try to build - the list of errors will let you double click through to each one and you know exactly how to fix it. Time consuming but probably the only easy way forward.

I suffer the same with R file and resources for redundant qualifier names and I do this:

Cntrl Shift + R

Fill "search box" with your package.R

com.yourpackage.R 

Fill "replace box" with

R

Them see results and click replace with the references you want

For me is the fasted workaround for now, hope someday the option cleanup code do it for itself

For future questioners, note that in Visual Studio 2019, you can do this similar to Resharper. Right click on a refactoring suggestion and there should be a "fix in entire Solution" option.

VS 2019 解决方案范围内的重构

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM