Skip to content
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

Eagerly bind AssignPiece if it can't block split and operands don't fit. #1477

Merged
merged 4 commits into from
May 7, 2024

Conversation

munificent
Copy link
Member

If neither of the two operands to an AssignPiece can be block formatted, and they contain newlines or the whole thing doesn't fit the page width, then the AssignPiece will definitely split at the operator.

This optimization helps a few rare cases (like deeply nested curried-style functions) from going pathological. I noticed it when migrating one of the regression tests over.

It doesn't have a noticeable affect on formatting the whole Flutter repo, but it doesn't hurt either.

If neither of the two operands to an AssignPiece can be block formatted,
and they contain newlines or the whole thing doesn't fit the page width,
then the AssignPiece will definitely split at the operator.

This optimization helps a few rare cases (like deeply nested
curried-style functions) from going pathological. I noticed it when
migrating one of the regression tests over.

It doesn't have a noticeable affect on formatting the whole Flutter
repo, but it doesn't hurt either.
@munificent munificent merged commit 1cc5a25 into main May 7, 2024
7 checks passed
@munificent munificent deleted the page-width-optimize-assign branch May 7, 2024 21:35
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.

None yet

3 participants