CodeIndentingRewriter

public class CodeIndentingRewriter : SyntaxRewriter

Rewriter that indents or unindents a syntax piece including comments and nested AST nodes (e.g. a code block in a code block).

  • Style defining whether the rewriter shall indent or unindent and whether it shall use tabs or spaces and how many of them.

    See more

    Declaration

    Swift

    public enum IndentationStyle
  • Initializer accepting an indentation style.

    Declaration

    Swift

    public init(style: IndentationStyle = .indentSpaces(4))

    Parameters

    style

    Indentation style. The default is indentation by 4 spaces.

  • Declaration

    Swift

    override public func visit(_ token: TokenSyntax) -> TokenSyntax