Skip to content

Passing a wrapped function literal produces bad indentation #569

Open
@nex3

Description

@nex3

When a function literal is wrapped in a higher-order function, the formatter indents it more than it would if it weren't wrapped. For example:

void main() {
  test("description 1", () {
    expect(setUpRun, isTrue);
    setUpRun = false;
  });

  test("description 1", expectAsync0(() {
    expect(setUpRun, isTrue);
    setUpRun = false;
  }, max: 1));
}

is formatted as:

void main() {
  test("description 1", () {
    expect(setUpRun, isTrue);
    setUpRun = false;
  });

  test(
      "description 1",
      expectAsync0(() {
        expect(setUpRun, isTrue);
        setUpRun = false;
      }, max: 1));
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions