ReSharper for Visual Studio Code 2026.1 Help

Code Syntax Style: Optional Parentheses

In many cases, parentheses in expressions are optional. Sometimes they help you clarify precedence of operations — for example if ((a & b) | c), sometimes, however, they do not help at all and just add up to dead code — var d = a + (b + c);. ReSharper will help you define where optional parentheses are helpful to you, and then either clean up the redundant parenthesis or automatically add missing ones where necessary.

ReSharper helps you arrange optional parentheses in the existing code and takes your preferences into account when it produces new code with code completion and performs refactorings.

Enforce preferences for optional parentheses

By default, ReSharper highlights parentheses that do not clarify operation precedence and helps remove them:

Removing redundant parentheses

Similarly, it notifies you about non-obvious operation precedences and suggests adding optional parentheses to make the code more readable.

Configure preferences for optional parentheses

You can configure syntax style settings via EditorConfig. These settings can be stored in .editorconfig files on different levels of your solution hierarchy. The files are normally put under VCS so that settings defined there are shared among the project team.

If you have used ReSharper for Visual Studio or JetBrains Rider on your computer, or have opened the current solution using these tools, ReSharper for Visual Studio Code will read and apply your syntax style settings from .DotSettings files. However, any settings configured via .editorconfig will take precedence.

Configure preferences for optional parentheses style using EditorConfig

  1. Open the desired .editorconfig file.

  2. Add the required optional parentheses style properties to the file. For example:

    parentheses_redundancy_style = remove_if_not_clarifies_precedence
03 March 2026