-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
string interpolation part crossing max line length introduces new line and lots of whitespace #1511
Comments
Ideally if the expression gets formatted and is still 1 line, we could allow it to be kept in place. If it needs to be multiline, perhaps they should be at start of line and indent based on its own context only. Thoughts? Happy to try and help again if we come up with a desirable solution |
Hey Jonathan, thank you for reporting this issue. fantomas/src/Fantomas/CodePrinter.fs Line 2673 in f828c65
In your case, the latter happened. You could easily change this and remove the fantomas/src/Fantomas.Tests/InterpolatedStringTests.fs Lines 82 to 110 in f828c65
So it is not that easy to give here a good answer. When I originally went with the implementation of interpolated strings I kinda winged it as the style guides did not have any guidance at the time. Could you perhaps raise in https://docs.microsoft.com/en-us/dotnet/fsharp/style-guide/formatting what needs to happen if the construct is actually multiline? Once we know that, we can act upon this. If the guide does not dictate any extra newlines and indents than the fix is quite easy as described above. |
Visual issue only as the new line and whitespace is all inside of the expression part, the string literal is unaffected.
Issue created from fantomas-online
Code
Result
Problem description
Please describe here the Fantomas problem you encountered.
Check out our Contribution Guidelines.
Extra information
Options
Fantomas Master at 03/06/2021 17:13:59 - f828c65
Default Fantomas configuration
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: