Export (0) Print
Expand All

IVsExpansionFunction Interface

Represents an expansion function in a code snippet.

Namespace: Microsoft.VisualStudio.TextManager.Interop
Assembly: Microsoft.VisualStudio.TextManager.Interop.8.0 (in microsoft.visualstudio.textmanager.interop.8.0.dll)

[GuidAttribute("563011A2-1611-48ED-B3B1-189060064F66")] 
[InterfaceTypeAttribute(1)] 
public interface IVsExpansionFunction
/** @attribute GuidAttribute("563011A2-1611-48ED-B3B1-189060064F66") */ 
/** @attribute InterfaceTypeAttribute(1) */ 
public interface IVsExpansionFunction
GuidAttribute("563011A2-1611-48ED-B3B1-189060064F66") 
InterfaceTypeAttribute(1) 
public interface IVsExpansionFunction

An expansion function in a code snippet is a function name associated with a particular field in the code snippet and can represent a single value or a list of values (which is presented in an IntelliSense completion list). See Function Element (IntelliSense Code Snippets) for details on how expansion functions are declared in a code snippet file.

The function name is used to obtain an expansion function object as represented by the IVsExpansionFunction interface from a language service. That IVsExpansionFunction object is then asked for the value or values to be presented in the field when the code snippet is inserted. This allows for dynamically generated values based on the context in which the code snippet is inserted.

NoteNote

An expansion function represents either a single value or a list of values but it cannot represent both.

Notes to Implementers A language service implements this interface to represent an expansion function. For each distinct expansion function supported, the language service must return a unique implementation of this interface. For example, if the language service supports two expansion functions, say, GetLocalName and GetNextClassName, the language service must implement a separate class that implements the IVsExpansionFunction interface for each expansion function. Then the language service must return an instance of each class for each expansion function.

Notes to Callers An IVsExpansionFunction object is returned from the GetExpansionFunction method in the IVsExpansionClient interface.

Community Additions

ADD
Show:
© 2014 Microsoft