ProvideLanguageServiceAttribute.MatchBraces ProvideLanguageServiceAttribute.MatchBraces ProvideLanguageServiceAttribute.MatchBraces Property

Definition

Determines if the language service supports matching language pairs.

public bool MatchBraces { get; set; }
member this.MatchBraces : bool with get, set
Public Property MatchBraces As Boolean
Property Value

Returns true if matching language pairs is supported; otherwise, returns false.

Examples

[ProvideLanguageService(typeof(MyLanguageService),           // Required  
                        MyConstants.languageName,            // Required  
                        MyConstants.languageNameResourceID,  // Required  
    // Optional language service properties  
    MatchBraces = true,  // brace matching is supported  
                       )]  

Remarks

All computer languages support what can be called language pairs such as '{' and '}', '(' and ')', or '<' and '>'. It is possible to position the caret after an element of a language pair and type Ctrl-] to jump to the corresponding matching pair. A language service indicates its support for matching language pairs in this manner by setting the MatchBraces property to true. To indicate support for matching pairs while typing, the MatchBracesAtCaret property must also be set to true.

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]\  
    MatchBraces = reg_dword: 0x00000001  

Applies to