Source::ReformatSpan Method (EditArray^, TextSpan)
Format the specified span of source.
Assembly: Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)
Parameters
- mgr
-
Type:
Microsoft.VisualStudio.Package::EditArray^
An EditArray object that contains the source to be reformatted.
- span
-
Type:
Microsoft.VisualStudio.TextManager.Interop::TextSpan
A TextSpan object describing the range of lines to be reformatted.
The EditArray object encapsulates all changes made as a single edit operation for the purposes of undo. So all changes made to the source file have to be given to the EditArray by calling the Add method with each line updated or with a single span encompassing the entire span being formatted.
This method is called when the user selects Format Selection or Format Document. This method is called only if the EnableFormatSelection property is true.
The base method does nothing.
In the default managed package framework implementation of the language service classes, this method is called from the ReformatSelection method and the ReformatDocument method in the ViewFilter class.
See Reformatting Code (Managed Package Framework) for examples of how this method can be implemented and used.