ReSharper 8.0 Web Help

ReSharper can reformat C#, VB.NET, JavaScript, CSS, XML, and other code according to settings configurable in the ReSharper options pages:

  • Code Editing | General Formatting Style
  • Code Editing | [Language] | Formatting Style

To reformat code with Code Cleanup
  1. Choose ReSharper | Options in the main menu.
  2. Use the Code Editing | General Formatting Style page and/or Code Editing | [Language] | Formatting Style pages to configure formatting settings so that they comply with your coding practices/standards.
  3. Click Save to apply the modifications and let ReSharper choose the settings layer, or choose a particular settings layer in the Save To drop-down list. To learn more about saving ReSharper settings, see JetBrains .NET Tools Blog: Save or Save To in ReSharper Options.
  4. Choose ReSharper | Tools | Cleanup Code in the menu to open the Code Cleanup dialog box for the current file or for a solution node (see Running Code Cleanup for details), and then select the Default: Reformat Code profile in the Available Profiles area.
  5. Click Run to perform Code Cleanup. ReSharper will reformat code in your selection, file, directory, project, or solution (depending on how you chose to run Code Cleanup) and according to your settings.

Note

The Default: Reformat Code profile does not reformat XML doc comments. You can use either Default: Full Cleanup profile or create your custom cleanup profile for it. For details, see Reformatting XML Doc Comments.


This feature is supported in the following languages/technologies:

C# VB.NET HTML ASPX Razor JavaScript TypeScript CSS XML XAML RESX Build Scripts
feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available

Tip

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see the corresponding topics in the ReSharper by Language section.