Source::GetExpansionProvider Method ()

 

Gets an expansion provider in support of code snippets.

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

public:
virtual ExpansionProvider^ GetExpansionProvider()

Return Value

Type: Microsoft.VisualStudio.Package::ExpansionProvider^

If successful, returns an ExpansionProvider object; otherwise, returns null (code snippet expansion is not supported).

A code snippet is a piece of code that is inserted at the current position in the source file, either as a result of typing a completion character (which shows a list of possible completion words that include code snippet names) or selecting Insert Snippet from the IntelliSense menu. If you need to support functionality beyond what the base ExpansionProvider class supports, you must derive a class from the Source class and override this method to instantiate your own version of the ExpansionProvider class.

The base method returns an existing ExpansionProvider object or creates a new ExpansionProvider object, sets it as the existing object, and returns it.

This method is typically called from the Source constructor.

See Support for Code Snippets (Managed Package Framework) for more information about how this method is used.

Return to top
Show: