-
Notifications
You must be signed in to change notification settings - Fork 125
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
Trailing commas for enhanced enums are not preserved #1678
Comments
This is working as intended. The enum values are always split, which is the intent of preserving trailing commas. It looks strange to have the I understand this does make it a tiny bit harder to edit the last value in the enum, but I believe the above output is what most users actually prefer so that's what it does. |
@munificent After rereading my initial comment here I think I wasn't as clear as I could have been. My proposal here is that with the Correct, me if I'm wrong but doesn't the new formatter currently always split enhanced enums? So there is no difference between I came to add this comment because it seems I'm not the only one who formats enums this way: #1660 (comment) |
It does not. You might be thinking of switch expressions, which are always split. But the new formatter will happily give you: enum E { a, b }
At the scale of our userbase, there are probably people who prefer just about every possible style option, but I have to be sensitive to using my time well. In this case, I suspect that there are not enough people for whom this style is important. |
I seem to got my terminology wrong then. I've always called
I can understand this, and if you don't mind I've given this issue a stab at solving, and have opened a PR #1703. |
Or, sorry, you're right.
I'm very busy the next couple of weeks, but I'll take a look when I get a chance. Thanks for the PR! |
This gets formatted into, even when trailing commas are preserved:
The text was updated successfully, but these errors were encountered: