delimitedIndent function

int? Function(TreeIndentContext) delimitedIndent({
  1. required String closing,
  2. bool align = true,
  3. int units = 1,
})

An indentation strategy for delimited (usually bracketed) nodes.

Will, by default, indent one unit more than the parent's base indent unless the line starts with a closing token. When align is true and there are non-skipped nodes on the node's opening line, the content of the node will be aligned with the end of the opening node, like this:

foo(bar,
    baz)

Implementation

int? Function(TreeIndentContext) delimitedIndent({
  required String closing,
  bool align = true,
  int units = 1,
}) {
  return (context) => _delimitedStrategy(context, align, units, closing, null);
}