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
Stroustrup: Two lists given directly as parameters, break code #2681
Comments
Hello, thank you for raising this issue. I took a quick look and this doesn't appear to be a regression due to project Dallas. (Sample) I believe the problem will be around: fantomas/src/Fantomas.Core/CodePrinter.fs Lines 1378 to 1379 in 8f2dead
Are you interested in submitting a PR? |
I just applied that and while it fixes the invalid code problem, it brought up another question for me of how the elmish syntax is kind of tangential to stroustrup. That change results in output like this: Layout.twoColumnLayoutWithStyles styles [
element1 longParameterName1 param2 param3
element1 longParameterName1 param2 param3
] [
element1 longParameterName1 param2 param3
element1 longParameterName1 param2 param3
] which matches elmish style, and technically matches stroustrup alignment, but I think this would make sense to be handled in a separate configuration option (e.g. I can PR this change as is but I thought I'd bring it up for discussion if you're open to discussing it separately. |
Thanks for the PR! I've had a similar thought on extracting this to its own setting. |
Issue created from fantomas-online
Code
Result
Problem description
When the items in the first list are big enough, it should add line breaks. But a space is removed between the first parameter and the first list. This is unfortunately invalid code.
Extra information
Options
Fantomas main branch at 2023-01-04T10:51:25Z - 1eb5725
Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?
The text was updated successfully, but these errors were encountered: