Condividi tramite


Declarations.GetInitialExtent(IVsTextView, Int32, Int32, Int32) Method

Definition

Override this method if you want to customize how the initial extent is calculated. If you do not implement this method the the Source object GetWordExtent will be used by default.

public:
 virtual bool GetInitialExtent(Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ textView, [Runtime::InteropServices::Out] int % line, [Runtime::InteropServices::Out] int % startIdx, [Runtime::InteropServices::Out] int % endIdx);
 virtual bool GetInitialExtent(Microsoft::VisualStudio::TextManager::Interop::IVsTextView const & textView, [Runtime::InteropServices::Out] int & line, [Runtime::InteropServices::Out] int & startIdx, [Runtime::InteropServices::Out] int & endIdx);
public virtual bool GetInitialExtent (Microsoft.VisualStudio.TextManager.Interop.IVsTextView textView, out int line, out int startIdx, out int endIdx);
abstract member GetInitialExtent : Microsoft.VisualStudio.TextManager.Interop.IVsTextView * int * int * int -> bool
override this.GetInitialExtent : Microsoft.VisualStudio.TextManager.Interop.IVsTextView * int * int * int -> bool
Public Overridable Function GetInitialExtent (textView As IVsTextView, ByRef line As Integer, ByRef startIdx As Integer, ByRef endIdx As Integer) As Boolean

Parameters

textView
IVsTextView

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

line
Int32

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

startIdx
Int32

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

endIdx
Int32

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

Returns

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

Remarks

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.

Applies to