Compartilhar via


LanguagePreferences.EnableShowMatchingBrace Property

Gets or sets whether or not the text included in the span of the matching pair is shown in the status bar.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)

Syntax

'Declaration
Public Property EnableShowMatchingBrace As Boolean
public bool EnableShowMatchingBrace { get; set; }
public:
property bool EnableShowMatchingBrace {
    bool get ();
    void set (bool value);
}
member EnableShowMatchingBrace : bool with get, set
function get EnableShowMatchingBrace () : boolean 
function set EnableShowMatchingBrace (value : boolean)

Property Value

Type: Boolean
true if the text included in the matching pair span can be shown, otherwise false.

Remarks

Note that this property does not affect the highlighting of matching braces, only whether any text is shown in the status bar.

When a matching pair of language elements is parsed, typically, the span of the actual pairs is returned in response to the ParseReason value MatchBraces. However, it is possible to include an additional span that specifies an associated language element. For example, in C#, "if (...)" typically precedes an opening brace. When the closing brace of the if statement is typed, the parser is asked for the matching brace. The parser locates the opening brace and can include the span for the "if (...)" as well. This additional text can be shown in the status bar if the EnableShowMatchingBrace property returns true. If the additional span is not included, then only the matching character is shown in the status bar. Be aware that any additional span returned is highlighted in the view as well.

This property is associated with the registry entry ShowMatchingBraces.

In the base method, even though this property can be set, the value is not written back to the registry.

.NET Framework Security

See Also

Reference

LanguagePreferences Class

Microsoft.VisualStudio.Package Namespace