IVsCompletionSet::GetBestMatch Method (String^, Int32, Int32, UInt32)
Determines the index of the closest matching completion set, given what has been typed so far.
Assembly: Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)
int GetBestMatch( String^ pszSoFar, int iLength, [OutAttribute] int% piIndex, [OutAttribute] unsigned int% pdwFlags )
Parameters
- pszSoFar
-
Type:
System::String^
[in] A string containing the text typed by the user.
- iLength
-
Type:
System::Int32
[in] Integer containing the length of the string.
- piIndex
-
Type:
System::Int32
[out] Returns an integer specifying the index.
- pdwFlags
-
Type:
System::UInt32
[out] Returns the type of match completed. For a list of pdwFlags values, see UpdateCompletionFlags.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From textmgr.idl:
HRESULT IVsCompletionSet::GetBestMatch( [in] const WCHAR *pszSoFar, [in] long iLength, [out] long *piIndex, [out] DWORD *pdwFlags );
Implement this method to determine the closest matching completion for a word given the text typed by the user. The view calls this method and passes in a string containing the text and the length of the string. In response to this call, return an index position into the completion set that identifies the best match, and a flag identifying the type of match performed.
The view calls this method only if CSF_CUSTOMMATCHING is specified in the completion set's flags.
If pdwFlags is set to either GBM_SELECT or GBM_UNIQUE, then the default matching in the view uses case-sensitive comparison.