Udostępnij za pośrednictwem


ProvideLanguageServiceAttribute.MatchBracesAtCaret Property

Definition

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

public:
 property bool MatchBracesAtCaret { bool get(); void set(bool value); };
public:
 property bool MatchBracesAtCaret { bool get(); void set(bool value); };
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.

Examples

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

Remarks

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