Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bnbarham opened this issue Mar 31, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@bnbarham
Copy link
Contributor

bnbarham commented Mar 31, 2023

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 }.

@bnbarham bnbarham added the bug Something isn't working label Mar 31, 2023
@ahoppen
Copy link
Member

ahoppen commented Mar 31, 2023

rdar://107454729

@ahoppen
Copy link
Member

ahoppen commented Apr 24, 2023

Fixed by #1569.

@ahoppen ahoppen closed this as completed Apr 24, 2023
kimdv added a commit to kimdv/swift-syntax that referenced this issue Apr 25, 2023
kimdv added a commit to kimdv/swift-syntax that referenced this issue Apr 25, 2023
kimdv added a commit to kimdv/swift-syntax that referenced this issue Apr 25, 2023
CippoX pushed a commit to CippoX/swift-syntax that referenced this issue Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants