Does the refactor "use" directives throughout the code base?

One of the things that I like about Visual Studio 2008 is the ability to reorganize and reorganize the “use” of directives in the source code files (this, perhaps, in 2005, I don’t remember).

In particular, I'm talking about how you can get it to reorganize directives in alphabetical order (albeit with basic FCL libraries floating at the top), and delete any directives that should not be there (either never been used or more not used).

Is there a way to automate this refactoring (sorting and cropping) throughout the old code base? Either through all the files in the solution, or through several decision files.

+3
source share
3 answers

I believe that you can make this decision widely using Power Commands

From PowerCommands Documentation:

Delete and Sort This command deletes and sorts with the help of operators for all classes, taking into account the project. This is useful, for example, when deleting or organizing using statements created by the wizard. This command can be executed from a node solution or a single node project.

+6
source

ReSharper () Visual Studio, " ", - . . , .

+4

PowerCommands Visual Studio '08. " ". , " → " ( " " ) ( vs) .

+1

Source: https://habr.com/ru/post/1702785/


All Articles