CompletionSet::GetInitialExtent Method (Int32, Int32, Int32)
Gets the initial extent of the text to be completed.
Assembly: Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)
public: virtual int GetInitialExtent( [OutAttribute] int% line, [OutAttribute] int% startIdx, [OutAttribute] int% endIdx )
Parameters
- line
-
Type:
System::Int32
[out] Returns the line number the text is on.
- startIdx
-
Type:
System::Int32
[out] Returns the character offset of the first character of the text.
- endIdx
-
Type:
System::Int32
[out] Returns the character offset of the last character of the text.
The initial extent is used to replace the text being completed with the selected item from the completion list.
This method is an implementation of the GetInitialExtent method on the IVsCompletionSet interface.
The base method first calls the GetInitialExtent method on the Declarations object that was passed to the Init method. If that call fails, the base method calls the GetCaretPos on the IVsTextView object passed to the Init method to get the current caret position. The base method then calls the GetWordExtent method on the Source object that was passed to the CompletionSet class constructor to retrieve the extent of the word containing the caret. If that call fails, the base method calls GetWordExtent again, this time with the position to the left of the caret. If that second call fails, the base method returns E_NOTIMPL; otherwise, the base method returns the found extent and returns a success code of S_OK. In other words, the base method tries very hard to determine the initial extent.