Partager via


AuthoringScope.GetDeclarations Method

Returns a list of declarations based on the specified reason for parsing.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   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.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

'Declaration
Public MustOverride Function GetDeclarations ( _
    view As IVsTextView, _
    line As Integer, _
    col As Integer, _
    info As TokenInfo, _
    reason As ParseReason _
) As Declarations
public abstract Declarations GetDeclarations(
    IVsTextView view,
    int line,
    int col,
    TokenInfo info,
    ParseReason reason
)
public:
virtual Declarations^ GetDeclarations(
    IVsTextView^ view, 
    int line, 
    int col, 
    TokenInfo^ info, 
    ParseReason reason
) abstract
abstract GetDeclarations : 
        view:IVsTextView * 
        line:int * 
        col:int * 
        info:TokenInfo * 
        reason:ParseReason -> Declarations
public abstract function GetDeclarations(
    view : IVsTextView, 
    line : int, 
    col : int, 
    info : TokenInfo, 
    reason : ParseReason
) : Declarations

Parameters

  • line
    Type: Int32

    [in] The line number where the parse operation started.

  • col
    Type: Int32

    [in] The offset into the line where the parse operation started.

Return Value

Type: Microsoft.VisualStudio.Package.Declarations
If successful returns a Declarations object; otherwise, returns a null value.

Remarks

This method is used to obtain a list of member declarations based on the given position in the source code in order to support the IntelliSense members list (a list of all members for a particular class or scope). Note that the parse operation has been completed by the time this method is called.

In the default managed package framework implementation, the Source class method Completion is called to present a list of declarations the user can select from to complete the entry of a particular identifier. The call to Completion is triggered when a parse operation returns a MemberSelect and the user is typing a character. Completion executes a parse operation and when the parse is complete, the GetDeclarations method is called to return the list of declarations to display. Note that the returned Declarations object is always your implementation of the Declarations class.

.NET Framework Security

See Also

Reference

AuthoringScope Class

Microsoft.VisualStudio.Package Namespace