Compartilhar via


Declarations.GetInitialExtent Method

Returns the initial extent of the text to be completed.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

'Declaration
Public Overridable Function GetInitialExtent ( _
    textView As IVsTextView, _
    <OutAttribute> ByRef line As Integer, _
    <OutAttribute> ByRef startIdx As Integer, _
    <OutAttribute> ByRef endIdx As Integer _
) As Boolean
public virtual bool GetInitialExtent(
    IVsTextView textView,
    out int line,
    out int startIdx,
    out int endIdx
)
public:
virtual bool GetInitialExtent(
    IVsTextView^ textView, 
    [OutAttribute] int% line, 
    [OutAttribute] int% startIdx, 
    [OutAttribute] int% endIdx
)
abstract GetInitialExtent : 
        textView:IVsTextView * 
        line:int byref * 
        startIdx:int byref * 
        endIdx:int byref -> bool  
override GetInitialExtent : 
        textView:IVsTextView * 
        line:int byref * 
        startIdx:int byref * 
        endIdx:int byref -> bool
public function GetInitialExtent(
    textView : IVsTextView, 
    line : int, 
    startIdx : int, 
    endIdx : int
) : boolean

Parameters

  • line
    Type: Int32%

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

  • startIdx
    Type: Int32%

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

  • endIdx
    Type: Int32%

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

Return Value

Type: Boolean
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.

.NET Framework Security

See Also

Reference

Declarations Class

Microsoft.VisualStudio.Package Namespace