AuthoringScope.GetDeclarations Method (IVsTextView, Int32, Int32, TokenInfo, ParseReason)

 

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

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

public abstract Declarations GetDeclarations(
	IVsTextView view,
	int line,
	int col,
	TokenInfo info,
	ParseReason reason
)

Parameters

view
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextView

[in] An IVsTextView object that can be used to access the source.

line
Type: System.Int32

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

col
Type: System.Int32

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

info
Type: Microsoft.VisualStudio.Package.TokenInfo

[in] A TokenInfo structure containing information about the token at the specified position.

reason
Type: Microsoft.VisualStudio.Package.ParseReason

[in] The ParseReason value describing what kind of parse operation was completed.

Return Value

Type: Microsoft.VisualStudio.Package.Declarations

If successful returns a Declarations object; otherwise, returns a null value.

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.

Return to top
Show: