ReSharper Web Help

Code Cleanup provides two default cleanup profiles - Reformat Code and Full Cleanup - for performing common tasks. They provide the advantage of using Code Cleanup right away, and you can't edit them. Instead, you can create your own custom profiles for performing specific tasks. See Creating Custom Profiles for guidelines.

The Reformat Code profile only modifies code formatting according to settings configurable in:

  • ReSharper | Options | Languages | C# | Formatting Style for C# code.
  • ReSharper | Options | Languages | Visual Basic .NET | Formatting Style for VB.NET.
  • ReSharper | Options | Languages | XML | Formatting Style for XML code.

That is, Reformat Code affects blank lines, layout of braces, line breaks, wrapping, spaces, indentation, aligning multiline constructs, and a number of other formatting options.

In fact, this profile replicates the functionality that has been implemented in previous versions of ReSharper as Reformat Code.

Full Cleanup is a lot more powerful profile as it complements code reformatting with additional actions. Specifically, it removes code redundancies, converts properties with backing fields to auto-properties, makes fields read-only if possible, arranges 'this' qualifier, and performs a number of other tasks (see table below).

Reformat Code vs Full Cleanup
Action Full Cleanup Reformat Code

C#

Arrange 'this' qualifier

feature available

feature not available

Remove code redundancies

feature available

feature not available

Use auto-property, if possible

feature available

feature not available

Make field read-only, if possible

feature available

feature not available

Use 'var' in declaration

Can change explicit to 'var' and vice versa, specifically:

  • In iterators: uses var except for simple types.
  • In local variables: uses var only when initializer has type usage.

Does not change anything

Update file header

feature not available

feature not available

Optimize using directives

feature available

feature not available

Shorten qualified references

feature available

feature not available

Reformat code

feature available

feature available

Reformat embedded XML doc comments

feature not available

feature not available

Reorder type members

feature available

feature not available

VB.NET

Optimize 'import' directives

feature available

feature not available

Shorten qualified references

feature available

feature not available

Reformat code

feature available

feature available

XML

Reformat code

feature available

feature available

See Also

Procedures

Reference