Skip to content

Fix CodeGenerationFormat.formatChildrenSeparatedByNewline() to not add an extra newline to the end of lists that already have one #2823

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

Conversation

roopekv
Copy link
Contributor

@roopekv roopekv commented Aug 26, 2024

This fixes a bug where CodeGenerationFormat.formatChildrenSeparatedByNewline() adds an extra newline to the end of lists that already have one.

…add an extra newline to the end of a list that already has one
@roopekv roopekv changed the title Fix `CodeGenerationFormat.formatChildrenSeparatedByNewline()' to not add an extra newline to the end of lists that already have one Fix CodeGenerationFormat.formatChildrenSeparatedByNewline() to not add an extra newline to the end of lists that already have one Aug 26, 2024
Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you ❤️ Nice clean up

…Newline`

Co-authored-by: Alex Hoppen <alex@alexhoppen.de>
@roopekv
Copy link
Contributor Author

roopekv commented Aug 26, 2024

Do I squash commits, or is this ok?

@roopekv
Copy link
Contributor Author

roopekv commented Aug 26, 2024

The view mode change didn't affect generated code, but it made the line longer so that it should wrap. I'll run format and commit once more.

EDIT: Done

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ahoppen
Copy link
Member

ahoppen commented Aug 26, 2024

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge August 26, 2024 18:59
@ahoppen
Copy link
Member

ahoppen commented Aug 26, 2024

@swift-ci Please test

@ahoppen
Copy link
Member

ahoppen commented Aug 26, 2024

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member

ahoppen commented Aug 26, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 6f55f29 into swiftlang:main Aug 26, 2024
3 checks passed
@roopekv roopekv deleted the fix-extra-newline-after-code-gen-list-format branch August 27, 2024 13:53
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