Resharper Tip / Trick ... is this possible?

How can I convert a resharper configuration file for example

using Stuff; using Stuff.MoreStuff; using Stuff.MoreStuff.EvenMoreStuff; namespace CoolStuff { // src code } 

For

 namespace CoolStuff { #region Using Statements using Stuff; using Stuff.MoreStuff; using Stuff.MoreStuff.EvenMoreStuff; #endregion // src code } 

I just like this way, it, I think, is also included in one of the rules of style. I would appreciate any help.

thanks

+4
source share
1 answer

In the ReSharper options, find the Import Namespace page under C # → Formatting Style. In it, check the box next to "Add usage directive to the largest area."

Then go to the bottom "Tools" section and select the "Clear Code" page. Create a new cleaning profile and check the "Embrace" box using the "directives in the region" option, setting "Using Statement" as the name of the region on the next line. Make sure that "Optimize" using the "directives" is checked. You can enable or disable other cleaning settings as you like.

Then you can start cleaning the code in the file by pressing Ctrl + E , C (or Ctrl + E , F if you set this profile as your silent clean -up).

+9
source

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


All Articles