ExpansionProvider.GetExpansionSpan Method

Returns the span occupied by the snippet currently being edited.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)

Syntax

'Declaration
Public Overridable Function GetExpansionSpan As TextSpan
public virtual TextSpan GetExpansionSpan()
public:
virtual TextSpan GetExpansionSpan()
abstract GetExpansionSpan : unit -> TextSpan  
override GetExpansionSpan : unit -> TextSpan
public function GetExpansionSpan() : TextSpan

Return Value

Type: Microsoft.VisualStudio.TextManager.Interop.TextSpan
Returns a TextSpan object representing the snippet's span in the source file.

Remarks

The base method obtains the span by calling the GetSnippetSpan method on the IVsExpansionSession object representing the current snippet expansion session. This method assumes the expansion session has been set by a previous call to the InsertSpecificExpansion or InsertNamedExpansion methods.

In the default managed package framework's implementation of the language service classes, this method is called from the HandlePreExec method to determine where to put the edit caret when the Enter key is typed during a snippet edit session.

.NET Framework Security

See Also

Reference

ExpansionProvider Class

Microsoft.VisualStudio.Package Namespace