Formatter Class

Definition

Formats whitespace in documents or syntax trees.

C#
public static class Formatter
Inheritance
Formatter

Properties

Annotation

The annotation used to mark portions of a syntax tree to be formatted.

Methods

Format(SyntaxNode, IEnumerable<TextSpan>, Workspace, OptionSet, CancellationToken)

Formats the whitespace in areas of a syntax tree identified by multiple non-overlapping spans.

Format(SyntaxNode, SyntaxAnnotation, Workspace, OptionSet, CancellationToken)

Formats the whitespace in areas of a syntax tree corresponding to annotated nodes.

Format(SyntaxNode, TextSpan, Workspace, OptionSet, CancellationToken)

Formats the whitespace in areas of a syntax tree identified by a span.

Format(SyntaxNode, Workspace, OptionSet, CancellationToken)

Formats the whitespace of a syntax tree.

FormatAsync(Document, IEnumerable<TextSpan>, OptionSet, CancellationToken)

Formats the whitespace in areas of a document corresponding to multiple non-overlapping spans.

FormatAsync(Document, OptionSet, CancellationToken)

Formats the whitespace in a document.

FormatAsync(Document, SyntaxAnnotation, OptionSet, CancellationToken)

Formats the whitespace in areas of a document corresponding to annotated nodes.

FormatAsync(Document, TextSpan, OptionSet, CancellationToken)

Formats the whitespace in an area of a document corresponding to a text span.

GetFormattedTextChanges(SyntaxNode, IEnumerable<TextSpan>, Workspace, OptionSet, CancellationToken)

Determines the changes necessary to format the whitespace of a syntax tree.

GetFormattedTextChanges(SyntaxNode, TextSpan, Workspace, OptionSet, CancellationToken)

Determines the changes necessary to format the whitespace of a syntax tree.

GetFormattedTextChanges(SyntaxNode, Workspace, OptionSet, CancellationToken)

Determines the changes necessary to format the whitespace of a syntax tree.

OrganizeImportsAsync(Document, CancellationToken)

Organizes the imports in the document.

Applies to

Product Versions
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.3.1, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 4.0.1, 4.1.0, 4.12.2, 4.13.0