CompletionSet::GetBestMatch Method (String^, Int32, Int32, UInt32)
Determines which item in the list is the best match for the text typed so far by the user.
Assembly: Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)
public: virtual int GetBestMatch( String^ textSoFar, int length, [OutAttribute] int% index, [OutAttribute] unsigned int% flags )
Parameters
- textSoFar
-
Type:
System::String^
[in] The text that has been typed by the user.
- length
-
Type:
System::Int32
[in] The length of the text typed by the user.
- index
-
Type:
System::Int32
[out] Returns the index of the item in the Declarations object that best matches the typed text.
- flags
-
Type:
System::UInt32
[out] Returns a set of flags from the UpdateCompletionFlags enumeration.
This method is an implementation of the GetBestMatch method on the IVsCompletionSet interface.
If textSoFar is not empty, the base method calls the GetBestMatch method on the Declarations object that was passed to the Init method; otherwise, if there is only one item in the Declarations list then that entry is used. If a match is found, the flags parameter is set to GBM_SELECT and if the match is unique (that is, there is only match in the list) then the flag GBM_UNIQUE is added to the flags parameter. The base method always returns a success code of S_OK.