Class DefaultNodeFormatter<T>

Represents an object that allows to format certain parts of a specific node, like its keywords or properties.

Type Parameters

Implements

Constructors

Properties

astNode: T

Methods

  • Creates a new formatting region that contains all nodes between the given formatting regions.

    For example, can be used to retrieve a formatting region that contains all nodes between two curly braces:

    const formatter = this.getNodeFormatter(node);
    const bracesOpen = formatter.keyword('{');
    const bracesClose = formatter.keyword('}');
    formatter.interior(bracesOpen, bracesClose).prepend(Formatting.indent());

    Parameters

    • start: FormattingRegion

      Determines where the search for interior nodes should start

    • end: FormattingRegion

      Determines where the search for interior nodes should end

    Returns FormattingRegion