ReSharper 2021.2 Help

Highlight matching delimiters

When you work with code in the editor, ReSharper can help you quickly understand code structure by highlighting the opening or closing delimiter ((), [], {}, and <>) when you set the caret at its pair. Any opening parenthesis, bracket, brace or quote (altogether called "delimiters") can be highlighted with color or outline whenever you place the caret at the corresponding closing delimiter, and vice versa.

If necessary, you can change the default behavior in the following ways:

  • Highlighting of matching delimiters can be turned off.

  • ReSharper can highlight the matching delimiter only when the caret is at outer side, or when it is at any side of its pair.

  • ReSharper can highlight matching delimiters with a color

    ReSharper: Highlighting the matching delimiter with color

    or with an outline border:

    ReSharper: Highlighting the matching delimiter with an outline border
  • The color of delimiter highlighting is configurable.

To define how ReSharper highlights matching delimiters, use the Highlight matching delimiters preference on the Environment | Editor | Appearance page of ReSharper options (Alt+R, O).

To specify the color to highlight matching delimiters, go to the Visual Studio options (Tools | Options), open the Environment | Fonts and Colors page, and then select the desired colors for the ReSharper Brace Outline and/or ReSHarper Matched Brace items.

This feature is supported in the following languages and technologies:

Language: C#

Language: VB.NET

Language: C++

Language: HTML

Language: ASP.NET

Language: Razor

Language: JavaScript

Language: TypeScript

Language: CSS

Language: XML

Language: XAML

Language: Resx

Language: Build Scripts

Language: Protobuf

Language: JSON

Feature is available in C#

Feature is available in Visual Basic .NET

Feature is available in C++

Feature is available in HTML

Feature is available in ASP.NET

Feature is available in Razor

Feature is available in JavaScript

Feature is available in TypeScript

Feature is available in CSS

Feature is available in XML

Feature is available in XAML

Feature is available in Resource files

Feature is available in build script files

Feature is not available in Protobuf

Feature is available in JSON

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by language section.

Last modified: 20 August 2021