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

Better formatting for long type parameter bounds. #1576

Merged
merged 2 commits into from
Oct 8, 2024
Merged

Conversation

munificent
Copy link
Member

The tall style was already doing a better job on #1568 than the old short style does. (I don't know why it leaves an overly long line there. It seems like a bug but perhaps a nasty subtle one in the solver.)

But it still didn't allow splitting before extends in a bound which could leave long lines in cases where the type parameter and bound name are both quite long. Rare, but we may as well do a better job.

So this introduces a new piece that allows splitting before extends if needed.

Fix #1568.

cc @stereotype441 Take a look at the regression test if you want to see how the new style handles your example.

The tall style was already doing a better job on #1568 than the old
short style does. (I don't know why it leaves an overly long line there.
It seems like a bug but perhaps a nasty subtle one in the solver.)

But it still didn't allow splitting before `extends` in a bound which
could leave long lines in cases where the type parameter and bound name
are both quite long. Rare, but we may as well do a better job.

So this introduces a new piece that allows splitting before `extends`
if needed.

Fix #1568.
lib/src/front_end/ast_node_visitor.dart Show resolved Hide resolved
lib/src/piece/bound.dart Outdated Show resolved Hide resolved
@munificent munificent merged commit f408350 into main Oct 8, 2024
7 checks passed
@munificent munificent deleted the split-bounds branch October 8, 2024 23:38
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.

Line longer than 80 characters in class type parameters
3 participants