Source.MatchBraces 方法

显示语言元素对的命名范围位置之一个元素。

命名空间:  Microsoft.VisualStudio.Package
程序集:   Microsoft.VisualStudio.Package.LanguageService.10.0(在 Microsoft.VisualStudio.Package.LanguageService.10.0.dll 中)
  Microsoft.VisualStudio.Package.LanguageService(在 Microsoft.VisualStudio.Package.LanguageService.dll 中)
  Microsoft.VisualStudio.Package.LanguageService.11.0(在 Microsoft.VisualStudio.Package.LanguageService.11.0.dll 中)
  Microsoft.VisualStudio.Package.LanguageService.9.0(在 Microsoft.VisualStudio.Package.LanguageService.9.0.dll 中)

语法

声明
Public Overridable Sub MatchBraces ( _
    textView As IVsTextView, _
    line As Integer, _
    index As Integer, _
    info As TokenInfo _
)
public virtual void MatchBraces(
    IVsTextView textView,
    int line,
    int index,
    TokenInfo info
)

参数

  • line
    类型:System.Int32
    语言元素的行号可以找到匹配。
  • index
    类型:System.Int32
    在位置的行的偏移量。

备注

此方法调用显示最内层的匹配的语言元素为字符在给定位置。相对于元素可能包括,例如, {和}, (和),或者 AMP_LT 和 AMP_GT 或内容。语言确定是相对。

该基方法开始执行在一个原因的 HighlightBraces特定位置的分析。分析,通常指定两个语言元素的两个范围的因此,该给定视图显示。如果 EnableShowMatchingBrace 属性是 true,则匹配的语言元素的前 80 个字符在状态栏显示。EnableShowMatchingBrace 详细说明了这一点。

此方法从 OnCommand 通常由方法调用,在相对于字符在当前脱字号位置前使用找到,并 EnableMatchBraces 属性是 true ,并且或者除 backspace 之外的某键入字符或 EnableMatchBracesAtCaret 属性是 true。

请参见 括号匹配 (托管包结构) 使用括号匹配如何的示例可以在语言服务中完成。

.NET Framework 安全性

请参见

参考

Source 类

Microsoft.VisualStudio.Package 命名空间

其他资源

括号匹配 (托管包结构)