-
Notifications
You must be signed in to change notification settings - Fork 439
Add buildFinalResult
to CodeBlockItemListBuilder
to ensure newline between expressions
#2829
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
Add buildFinalResult
to CodeBlockItemListBuilder
to ensure newline between expressions
#2829
Conversation
242817b
to
8f477f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mateusrodriguesxyz. Could you add a test case for this?
8f477f3
to
357c104
Compare
@ahoppen done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nitpick, otherwise looks good to me.
357c104
to
83244d4
Compare
@swift-ci Please test |
Not entirely sure why but there seems to be a build failure on Linux only. 🤔 Could you take a look at it @mateusrodriguesxyz? |
…e between expressions
… adding unnecessary separators
Head branch was pushed to by a user without write access
83244d4
to
95f5aa6
Compare
@swift-ci Please test |
@swift-ci Please test |
This ensures that the following usage of
CodeBlockItemListBuilder
produces a valid block where expressions are separated by newlines:Something similar it's already done for comma separated lists here.
I've also modified the
collapse
function to avoid adding unnecessary separators to a macro expansion. This change is important because if someone usesCodeBlockItemListBuilder
as in testDontAddIndentationWhenCollapsingBody, they might be surprised by unexpected empty lines ifcollapse
adds separator unconditionally.