Вопрос

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?

Это было полезно?

Решение

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 solution-wide refactor

Другие советы

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:

CntrlShift+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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top