Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Resharper StyleCop Code Cleanup to create regions

Upon code clean up (profile: StyleCop) it always creates regions for constructors, properties and so on...

#region Constructors and Destructors

public IpDiagnosticsService()
{
    // : base()
    // NOP. Required for serializer.
}

public IpDiagnosticsService(string applicationName, SPFarm farm) : base(applicationName, farm)
{
    // NOP
}

#endregion

#region Properties

// ...omitted.

#endregion

Awesome. I don't want that. How do it turn this off? Couldn't find any option for that.

like image 946
lapsus Avatar asked Jul 31 '14 12:07

lapsus


People also ask

How to run ReSharper code cleanup?

Select ReSharper | Options from the main menu or press Alt+R O . Go to the cleanup profiles settings page: Code Editing | Code Cleanup | Profiles. Select which Code Cleanup profile should be applied on save and click Set as default (the default profile is also used for silent cleanup).

What does code clean up do?

Code cleanup refers to the act of writing code so that it cleans up leftover data structures and other unwanted materials from memory and the filesystem. It is sometimes treated as a synonym of refactoring code, which involves making the source code itself easier to understand, maintain, and modify.

What is the code for cleanup code in Visual Studio?

Right-click on the project or solution name in Solution Explorer, select Analyze and Code Cleanup, and then select Run Code Cleanup.


1 Answers

Resharper depends on an XML file that defines the layout of the files. It can be found under Resharper -> Options -> Code Editing -> C# -> Type Members Layout.

enter image description here

Remove the <Group Region="*"/> elements to remove the region creation. More details about the file format can be found here.

like image 65
jessehouwing Avatar answered Oct 18 '22 13:10

jessehouwing