CompletionSet.GetBestMatch 方法

确定列表中的至此哪个项是最佳匹配对于用户键入的文本。

命名空间:  Microsoft.VisualStudio.Package
程序集:   Microsoft.VisualStudio.Package.LanguageService.11.0(在 Microsoft.VisualStudio.Package.LanguageService.11.0.dll 中)
  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.9.0(在 Microsoft.VisualStudio.Package.LanguageService.9.0.dll 中)

语法

声明
Public Overridable Function GetBestMatch ( _
    textSoFar As String, _
    length As Integer, _
    <OutAttribute> ByRef index As Integer, _
    <OutAttribute> ByRef flags As UInteger _
) As Integer
public virtual int GetBestMatch(
    string textSoFar,
    int length,
    out int index,
    out uint flags
)

参数

  • textSoFar
    类型:System.String
    [in] 由用户键入的文本。
  • length
    类型:System.Int32
    [in] 该文本的长度由用户键入的。

返回值

类型:System.Int32
如果成功,则返回; S_OK否则,返回错误代码。

实现

IVsCompletionSet.GetBestMatch(String, Int32, Int32%, UInt32%)

备注

此方法是 GetBestMatch 方法的实现。 IVsCompletionSet 接口的。

如果 textSoFar 不为空,基方法调用传递给 Init 方法的 Declarations 对象的 GetBestMatch 方法;否则,因此,如果只有在 Declarations 的项列表然后使用项。如果找到匹配项, flags 参数设置为 GBM_SELECT ,并且,如果它是唯一的 (即具有在列表中只匹配) 标志 GBM_UNIQUE 然后添加到 flags 参数。该基方法始终返回 S_OK成功代码。

.NET Framework 安全性

请参见

参考

CompletionSet 类

Microsoft.VisualStudio.Package 命名空间