ProvideLanguageServiceAttribute.MatchBracesAtCaret ProvideLanguageServiceAttribute.MatchBracesAtCaret ProvideLanguageServiceAttribute.MatchBracesAtCaret Property


Determines if a language service supports matching language pairs while typing.

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

Returns true if language pairs can be matched while typing; otherwise, returns false.


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


All computer languages support what can be called language pairs such as '{' and '}', '(' and ')', or '<' and '>'. When an element of a language is typed or moved over by the caret, the corresponding matching element can be highlighted. A language service indicates its support for matching language pairs in this manner by setting the MatchBracesAtCaret property to true. The MatchBraces 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]\  
    MatchBracesAtCaret = reg_dword: 0x00000001  

Applies to