Code Style. VB.NET
File | Settings | Editor | Code Style | VB.NET for Windows and Linux
JetBrains Rider | Settings or Preferences | Editor | Code Style | VB.NET for macOS
CtrlAlt0S
note
Preferences configurable on this page are saved using the mechanism of layer-based settings.
On this page of JetBrains Rider settings, you can configure various aspects of code style in VB.NET. Code style preferences are grouped in tabs, which are listed in this topic.
This tab helps you specify how JetBrains Rider should format indents in your code when you type or when you reformat existing code.
tip
Formatting preferences listed on the tab can be also configured via EditorConfig. To find the EditorConfig properties that correspond to each preference, refer to EditorConfig properties for VB.NET: Tabs and Indents.
If there are .editorconfig files that affect your solution, preferences on this and other tabs with code style settings could be overridden by EditorConfig styles. You will see a yellow warning if at least one preference on the page is overridden by EditorConfig or Clang-Format styles for the current file, each overridden preference will also be highlighted with yellow. For example:

If your preferences say that whitespaces should be used for indents, JetBrains Rider will also use whitespaces to align multiple constructs — for example, when function parameters on multiple lines are aligned by the first parameter:
void foo(int firstParameter,
int secondParameter)
{
}
However, when you choose to use tabs for indents, there could be different ways for aligning multi-line constructs. JetBrains Rider lets you choose which of these ways to use when creating new and reformatting existing code.
You can configure preferences for aligning multi-line constructs with the How to align when tabs are used for indents option .
warning
JetBrains Rider can automatically learn C# symbol naming rules from existing code. If you want to configure naming rules manually, clear the Use auto-detected rules checkbox on the Editor | Code Style | C# | Naming page of JetBrains Rider settings CtrlAlt0S.
On this tab, you can configure symbol naming rules for VB.NET.
JetBrains Rider helps you define, control, and apply desired naming styles for symbols in your code. There is a set of rules, each of which targets specific identifiers with the set of constraints (for example, a rule can target static private readonly fields) . Each rule can have one or more associated styles that define capitalization of compound words, underscores, suffixes, prefixes, and so on.
These rules are taken into account when JetBrains Rider produces new code with code completion and code generation features, applies code templates and performs refactorings. JetBrains Rider also helps you detect and fix violations of naming rules. If necessary, the automatic checkup of naming rules can be configured or disabled.
Preferences configurable on this tab help you enforce code syntax style — how to use interchangeable language syntax constructions. These preferences are taken into account when JetBrains Rider produces new code with code completion and code generation features, applies code templates and performs refactorings. They can also be 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 syntax style in the inspected scope differs from the preferred style. Using the selectors, you can configure severity levels of the inspections.
Reference qualification | Preferences in this section define the style of namespace imports:
|
This tab lets you configure whether JetBrains Rider should increase or decrease the number of blank lines around namespaces, members, regions and groups of import directives. You can adjust the values and check the preview pane at the bottom of the page to see how your preferences affect the code.
tip
Formatting preferences listed on the tab can be also configured via EditorConfig. To find the EditorConfig properties that correspond to each preference, refer to EditorConfig properties for VB.NET: Blank Lines.
Options in the Preserve Existing Formatting section are only applied when JetBrains Rider reformats existing code whereas the Blank Lines section contains options that also take effect when you type new code.
Use this tab to configure how JetBrains Rider should add or remove line breaks before/after specific language constructs, and whether to wrap long lines exceeding the length specified by the Hard wrap at preference. You can adjust the values and check the preview pane at the bottom of the page to see how your preferences affect the code.
tip
Formatting preferences listed on the tab can be also configured via EditorConfig. To find the EditorConfig properties that correspond to each preference, refer to EditorConfig properties for VB.NET: Line Breaks.
Note that preferences with names starting with Keep existing... allow you to keep existing formatting for other preferences in the same group.
Use this tab to configure how to insert or remove spaces in different code constructs. You can adjust the values and check the preview pane at the bottom of the page to see how your preferences affect the code.
tip
Formatting preferences listed on the tab can be also configured via EditorConfig. To find the EditorConfig properties that correspond to each preference, refer to EditorConfig properties for VB.NET: Spaces.
This tab helps configure a number of additional settings that control how JetBrains Rider treats new code and reformats existing code. You can adjust the values and check the preview pane at the bottom of the page to see how your preferences affect the code.
tip
Formatting preferences listed on the tab can be also configured via EditorConfig. To find the EditorConfig properties that correspond to each preference, refer to EditorConfig properties for VB.NET: Other.