ReSharper Web Help

ReSharper | Options | Code Editing | General Formatter Style

This page of ReSharper options allows you to define formatter options that apply for all languages.

Options in this page apply when ReSharper formats new or existing code (e.g., when you run code cleanup).

Item Description
How to indent multi-language files These options define how to indent non-primary languages in a code file. For example, JavaScript in an HTML file.
  • Indent all languages equally using settings from main language (as Visual Studio does)
    When this option is selected, ReSharper uses similar indents for all additional languages.
  • Indent each language using its own settings (as ReSharper 7 and older did). When this option is selected, ReSharper uses indents defined for each language in the corresponding settings pages: Code Editing | [Language] | Formatting Style.
How to align when tabs are used for indents These options define whether to use tabs when aligning multiple constructs. For example, in the following code snippet, the parameters that otherwise may be on the same line are aligned by the first parameter.
    void foo(int firstParameter,
             int secondParameter)
    {
    }
                    
The options apply only if usage of tabs (Keep tabs) is enabled in Visual Studio options (Tools | Options | Text Editor | All Languages | Tabs). Otherwise, spaces are always used for alignment.
  • Use spaces (recommended, looks aligned on any tab size)
    When this option is selected, ReSharper uses tabs for indents and spaces for alignment:
  • Only use tabs (inaccurate)
    When this option is selected, ReSharper uses tabs for both indents and alignment, which may not result in precise alignment:
  • Mix tabs and spaces for optimal fill
    When this option is selected, ReSharper uses tabs for both indents and alignment adds necessary spaces for precise alignment.

 Note

The first option is recommended because code aligned with second and third options may lose alignment when viewed in an editor with a different tab size.

 Note

ReSharper's settings are saved in settings layers that enable you to have different settings for different solutions as well as to share your settings with your team. To learn more, study the Managing and Sharing Options section.

See Also

Concepts