ProvideLanguageServiceAttribute.ShowMatchingBrace Property

 

Determines if the matching language pair is shown in the status bar.

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

public bool ShowMatchingBrace { get; set; }

Property Value

Type: System.Boolean

Returns true if the matching language pair is shown in the status bar; otherwise, returns false.

When a matching language pair is highlighted, the matched element can be displayed in the status bar if the ShowMatchingBrace property is set to true. This is not typically useful unless the text before the matching language element is also shown. For example, typing the closing brace '}' for an if statement where the opening brace '{' is on the same line as the if statement could show the entire if statement and opening brace in the status bar. This does mean that the if statement would also be highlighted along with the opening brace. The MatchBraces property must also be set to true for the ShowMatchingBrace property to be used.

This property is specific to the managed package framework (MPF).

The default is true when the corresponding registry entry is accessed through the LanguagePreferences class.

The registry entry looks like this:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\[X.Y]\Languages\Language Services\
  [Language Name]\
    ShowMatchingBrace = reg_dword: 0x00000001

[ProvideLanguageService(typeof(MyLanguageService),           // Required
                        MyConstants.languageName,            // Required
                        MyConstants.languageNameResourceID,  // Required
    // Optional language service properties
    ShowMatchingBrace = true,  // show matching brace in status bar
                       )]
Return to top
Show: