Creates a new formatting region that contains the all of the specified CST nodes.
A list of CST nodes to format
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());
Determines where the search for interior nodes should start
Determines where the search for interior nodes should end
Creates a new formatting region that contains the specified keyword of the supplied node.
The keyword to format. Scoped to the supplied node.
Optional
index: numberThe index of the keyword, necessary if the keyword appears multiple times. 0
by default. To retrieve all keywords, use the keywords method instead.
Creates a new formatting region that contains the all of the specified keywords of the supplied node.
Rest
...keywords: string[]The keywords to format. Scoped to the supplied node.
Creates a new formatting region that contains the specified node.
Creates a new formatting region that contains all of the specified nodes.
Rest
...nodes: AstNode[]Creates a new formatting region that contains the all of the specified properties of the supplied node.
Rest
...features: Properties<T>[]Creates a new formatting region that contains the specified property of the supplied node.
Optional
index: numberThe index of the property, if the property is an array. 0
by default. To retrieve all elements of this array, use the properties method instead.
Represents an object that allows to format certain parts of a specific node, like its keywords or properties.