Condividi tramite


Declarations.GetInitialExtent Method

Returns the initial extent of the text to be completed.

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

Syntax

'Dichiarazione
Public Overridable Function GetInitialExtent ( _
    textView As IVsTextView, _
    <OutAttribute> ByRef line As Integer, _
    <OutAttribute> ByRef startIdx As Integer, _
    <OutAttribute> ByRef endIdx As Integer _
) As Boolean
'Utilizzo
Dim instance As Declarations
Dim textView As IVsTextView
Dim line As Integer
Dim startIdx As Integer
Dim endIdx As Integer
Dim returnValue As Boolean

returnValue = instance.GetInitialExtent(textView, _
    line, startIdx, endIdx)
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: 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.

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

Declarations Members

Microsoft.VisualStudio.Package Namespace