Declarations::GetBestMatch Method (String^, Int32, Boolean)

 

Determines the best completion match for the specified value.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

public:
virtual void GetBestMatch(
	String^ value,
	[OutAttribute] int% index,
	[OutAttribute] bool% uniqueMatch
)

Parameters

value
Type: System::String^

[in] The text to match against. This typically represents the text typed by the user.

index
Type: System::Int32

[out] Returns the index of the item that best matches the value.

uniqueMatch
Type: System::Boolean

[out] Returns true if the best match is the only match and it matches the value exactly; otherwise, returns false.

This method is typically called from the GetBestMatch method in the CompletionSet class to determine which item in the IntelliSense completion list to highlight as characters are typed.

The base method calls the IsMatch method to look for a match. A unique match is indicated if the next item in the list does not match or the search is at the end of the list. If no match is found, index is set to the number of items in the list and uniqueMatch is set to true. If value is null or empty, a COMException exception is thrown.

Return to top
Show: