Skip to content

Add a group around member types used in return clauses. #149

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

Merged
merged 1 commit into from
Feb 24, 2020

Conversation

dylansturg
Copy link
Contributor

Without the group, the pretty printer would add a newline at the first break in the return clause where the column limit would overflow. This could fall inside of a member type identifier, before the dot. That results in odd formatting where a func decl has its return clause partially on the first line and partially on the second line (which is only allowed for tuples because of the opening paren special case).

With the group, the func decl breaks before the -> when the type would overflow the line.

Without the group, the pretty printer would add a newline at the first break in the return clause where the column limit would overflow. This could fall inside of a member type identifier, before the dot. That results in odd formatting where a func decl has its return clause partially on the first line and partially on the second line (which is only allowed for tuples because of the opening paren special case).

With the group, the func decl breaks before the -> when the type would overflow the line.
@allevato allevato merged commit 05ac891 into swiftlang:master Feb 24, 2020
@dylansturg dylansturg deleted the return_type_grouping branch February 25, 2020 00:57
aaditya-chandrasekhar pushed a commit to val-verde/swift-format that referenced this pull request May 20, 2021
* Add zero width space to escape emoji shortcodes

* Add changelog entries for swiftlang#149
aaditya-chandrasekhar pushed a commit to val-verde/swift-format that referenced this pull request May 20, 2021
* Revert "Add zero width space to escape emoji shortcodes (swiftlang#149)"

This reverts commit aeed63c.

* Extract StringProtocol helper methods into separate file

* Add and apply escapingEmojiShortcodes property where necessary

* Add Changelog entry for swiftlang#167

* Fix Swift 5.2 error 'closure containing control flow statement cannot be used with function builder'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants