Declarations::GetInitialExtent Method (IVsTextView^, Int32, Int32, Int32)

 

Returns the initial extent of the text to be completed.

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

public:
virtual bool GetInitialExtent(
	IVsTextView^ textView,
	[OutAttribute] int% line,
	[OutAttribute] int% startIdx,
	[OutAttribute] int% endIdx
)

Parameters

textView
Type: Microsoft.VisualStudio.TextManager.Interop::IVsTextView^

[in] An IVsTextView object representing the view that displays the source file.

line
Type: System::Int32

[out] The line number the caret is currently on.

startIdx
Type: System::Int32

[out] The character offset on the line to the first character of the text that is to trigger the commit.

endIdx
Type: System::Int32

[out] The character offset to the last character of the text that is to trigger the commit.

Return Value

Type: System::Boolean

If the initial extent was determined, returns true; otherwise, returns false.

This method must use some means to determine the initial extent of the text so that the completion list can be positioned properly. If this method returns false, then typically the caller calls the GetWordExtent method on the Source class to get the extent to use. One typical approach is to parse the text before the cursor and make adjustments to that text's extent to compensate for special characters (for example, in XML, it may be necessary to take into account the surrounding "<" and ">" characters). Since GetWordExtent does this already, the GetInitialExtent method typically does nothing and returns false.

This method is typically called from the GetInitialExtent method in the CompletionSet class.

The base method always sets line, startIdx, and endIdx to 0 and returns false.

Return to top
Show: