General Formatter Style
ReSharper's formatting options are configurable in a very flexible way and for each supported language separately. While this page provides a few general settings, the language-specific pages () allow you to fine-tune code formatting according to your coding standards and practices.
This page of ReSharper options allows you to specify general code formatting rules that apply for all languages.
The options that you configure on this page apply in the following cases:
- When you produce new code by typing or by using ReSharper's code completion features.
- When you produce new code by applying ReSharper's code templates.
- When new code is produces with the ReSharper's code generation features or refactorings.
- When you reformat existing code.
To configure auto-formatting of new code, use the Auto-format on semicolon and Auto-format on closing brace options in the ReSharper | Options | Environment | Editor | Editor Behavior.
|How to indent multi-language files||
These options define how to indent non-primary languages in a code file.
|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.
The options apply only if usage of tabs (Keep tabs) is enabled in Visual Studio options ( ). Otherwise, spaces are always used for alignment.