Preferences configurable on this page affect the behaviour of specific Code Style and Cleanup features. The preferences are taken into account when ReSharper applies refactorings, code templates or produces generated code. They can be also applied to the existing code by using code cleanup with the corresponding settings.
The preferences with the Notify with selector have corresponding code inspections that notify you if this aspect of the code style in the inspected scope differs from the the preferred style. Using these selectors, you can configure severity levels of the inspections.
|'var' usage in declarations||
Preferences in this section define how the
implicitly typed local variables
(also known as
|Instance members qualification||Preferences in this section define how to use 'this' qualifier. For more information, see Arranging Optional Member Qualifiers.|
|Static members qualification||Preferences in this section define how to qualify static members. For more information, see Arranging Optional Member Qualifiers.|
|Built-in type naming||The preference in this section defines how to reference C# built-in types: you can either use C# keywords or CLR type names. For more information, see Built-In Type References Style.|
Preferences in this section define the
style of namespace imports:
|Modifiers||Preferences in this section define how to arrange modifiers of types and members. For more information, see Arranging Modifiers.|
|Arguments||Preferences in this section lets you define how named or positional arguments should be enforced for specific types of parameters. For more information, see Using Named/Positional Arguments.|
|Parentheses||Preferences in this section lets you define when optional parentheses should be removed or added if they help you clarify precedence of operations. For more information, see Arranging Optional Parentheses.|
|Braces||Preferences in this section lets you define which statements require braces for single nested statements. For more information, see Using Braces for Single Nested Statements.|
|Attributes||Preference in this section define how to arrange multiple attribues. For more information, see Attributes Style.|
Changing code styles from the editor
You can also change specific code style preferences right in the editor, by pressing Alt+Enter where style violations are highlighted. For example, you can change the preference of 'var' usage in declarations for simple types:
... as well as severity level of the corresponding inspection:
Note that when you change prefernces from the editor, your changes are saved using the smart save logic.