swiftlang / swift-format

Formatting technology for Swift source code
Apache License 2.0
2.41k stars 219 forks source link

[SR-13011] swift-format doesn't approve of standard SwiftUI Button trailing closure syntax. #322

Open swift-ci opened 4 years ago

swift-ci commented 4 years ago
Previous ID SR-13011
Radar None
Original Reporter leisurehound (JIRA User)
Type Bug

Attachment: Download

Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | swift-format | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: d94a19ff926d1ac4c036ad3673897328

Issue Description:

In SwiftUI examples, Apple demonstrates how to utilize the action & view closures for the Button element with two trailing closures:

Button(action: {
// do something
}) {
  Text("Label")
}

But swift-format will suggest to revise function calling signature to remove multiple trailing closures.

ahoppen commented 3 months ago

Tracked in Apple’s issue tracker as rdar://126948289