Skip to content

BasicFormat does not add whitespace between end of previous closure and argument name for multi-trailing closures #1472

@bnbarham

Description

@bnbarham
func testMultiTrailingClosure() {
  var input = Parser("""
    foo { _ in
    }anotherClosure: { _ in
    }
    """)
  let call = ExprSyntax.parse(from: &input)

  let formatted = call.formatted()
  assertStringsEqualWithDiff(formatted.description, """
    foo { _ in
    } anotherClosure: { _ in
    }
    """)
}

Produces:

failed - Actual output (+) differed from expected output (-):
–foo { _ in
–} anotherClosure: { _ in
+foo { _ in 
+}anotherClosure: { _ in 
 }

ie. extra space after in and no space after }.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions