Declarations Class
Manages a list of declarations to be shown in an IntelliSense drop-down list.
This API is not CLS-compliant. The CLS-compliant alternative is [None].
Inheritance Hierarchy
Object
Microsoft.VisualStudio.Package.Declarations
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
<CLSCompliantAttribute(False)> _
Public MustInherit Class Declarations _
Implements IDisposable
[CLSCompliantAttribute(false)]
public abstract class Declarations : IDisposable
[CLSCompliantAttribute(false)]
public ref class Declarations abstract : IDisposable
[<AbstractClass>]
[<CLSCompliantAttribute(false)>]
type Declarations =
class
interface IDisposable
end
public abstract class Declarations implements IDisposable
The Declarations type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Declarations | Initializes a new instance of the Declarations class. |
Top
Properties
Name | Description | |
---|---|---|
LastBestMatch | Gets or sets the name of the item that best matches what has been typed so far. |
Top
Methods
Name | Description | |
---|---|---|
Dispose | Frees any resources allocated by the class just before the class object is destroyed. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetBestMatch | Determines the best completion match for the specified value. | |
GetCount | When implemented in a derived class, gets the number of items in the list of declarations. | |
GetDescription | When implemented in a derived class, gets a description of the specified item. | |
GetDisplayText | When implemented in a derived class, gets the text to be displayed in the completion list for the specified item. | |
GetGlyph | When implemented in a derived class, gets the image to show next to the specified item. | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetInitialExtent | Returns the initial extent of the text to be completed. | |
GetName | When implemented in a derived class, gets the name or text to be inserted for the specified item. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IsCommitChar | Determines whether the specified character can be used to complete the specified text. | |
IsMatch | Determines whether the specified text matches some or all of the specified item. | |
IsPerfectMatch | Determines whether the specified text matches all of the specified item. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnAutoComplete | Called after the declaration has been committed to the source file. When implemented in a derived class, it provides a completion character which may itself be a trigger for another round of IntelliSense. | |
OnCommit | Called to commit the specified item to the source file. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Remarks
This abstract class is used to manage a list of identifiers or declarations that are shown in an IntelliSense member completion list. If you intend to support IntelliSense in your application, you must provide a concrete class that derives from this class.
Notes to Implementers
The implemented methods of this class assume that the declarations are stored in a list that is sorted in ascending order.
If you intend to support the IntelliSense completion list, you must derive a class from the Declarations class and implement the following abstract methods:
Abstract Method |
Description |
---|---|
Returns number of items in declarations list |
|
Returns description for specified item. |
|
Returns text to be shown in the completion list for the specified item. |
|
Returns an index into an image list for the specified item. |
|
Returns the text to be inserted for the specified item. |
Notes to Callers
An instance of this class is returned from the GetDeclarations method in the AuthoringScope class. The GetDeclarations method must be implemented in a class derived from the AuthoringScope class. How your version of the Declarations class is populated is entirely up to you. The Declarations class is populated by the parser.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.