共用方式為


IVsCompletionSet Interface

Definition

Provides statement completion capabilities for the language service.

public interface class IVsCompletionSet
public interface class IVsCompletionSet
__interface IVsCompletionSet
[System.Runtime.InteropServices.ComConversionLoss]
[System.Runtime.InteropServices.Guid("0EF79249-B0BF-4CD0-A966-C4713546C3A5")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsCompletionSet
[System.Runtime.InteropServices.ComConversionLoss]
[System.Runtime.InteropServices.Guid("0EF79249-B0BF-4CD0-A966-C4713546C3A5")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsCompletionSet
[<System.Runtime.InteropServices.ComConversionLoss>]
[<System.Runtime.InteropServices.Guid("0EF79249-B0BF-4CD0-A966-C4713546C3A5")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsCompletionSet = interface
[<System.Runtime.InteropServices.ComConversionLoss>]
[<System.Runtime.InteropServices.Guid("0EF79249-B0BF-4CD0-A966-C4713546C3A5")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsCompletionSet = interface
Public Interface IVsCompletionSet
Derived
Attributes

Remarks

Implement this interface on your language service object to provide statement completion. Your language service object must also implement IOleCommandTarget. To pass the text view a pointer to your IOleCommandTarget implementation, call AddCommandFilter.

The command filter intercepts commands that the user types into the code window. Monitor the command information to know when to display statement completion information to the user. For example, statement completion information is provided in Visual C++ when the user types "->" and when the user types "." in Visual Basic.

Statement completion can also include displaying a list of completion options when a user types a letter in a particular scope. For example, typing 'c' in a namespace of a Visual C# program might present a list of all completions for that scope including "class". If the 'c' is typed inside a method's scope, however, the completions might include only those variables that start with the letter 'c' as "class" does not make sense inside a method.

All of these statement completions are part of the IntelliSense feature set.

Notes to Implementers

Implement this interface on your language service object to include statement completion in your language service. This interface can also be implemented in its own class.

Notes to Callers

Called by the view to return statement completion information to the user.

Methods

Dismiss()

Releases the completion set when it is no longer needed.

GetBestMatch(String, Int32, Int32, UInt32)

Determines the index of the closest matching completion set, given what has been typed so far.

GetCount()

Returns the number of items in the completion set.

GetDescriptionText(Int32, String)

Returns text describing the indicated item in the completion set.

GetDisplayText(Int32, String, Int32[])

Returns the text of a completion set item as it appears in the completion set list.

GetFlags()

Returns flags indicating specific behaviors of this completion set.

GetImageList(IntPtr)

Returns the list of images (glyphs) supported by the completion set.

GetInitialExtent(Int32, Int32, Int32)

Determines where to display the completion set list in the editor.

OnCommit(String, Int32, Int32, UInt16, String)

Determines how text is completed.

Applies to