-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Unexpected newline added before let bang #1932
Comments
AFAIU this should be marked as bug(stylistic) instead of bug(soundness)? |
I will try to solve this one |
Hello @ribeirotomas1904, thank you for your interest. This one is a bit trickier to solve, I believe a first step might be to revisit: fantomas/src/Fantomas/SourceParser.fs Lines 977 to 984 in b742103
I believe this active pattern is a bit too strict and should be more something like: let rec (|CompExprBody|_|) expr =
match expr with
| SynExpr.LetOrUse (_, _, _, CompExprBody _, _)
| SynExpr.LetOrUseBang _
| SynExpr.Sequential _ -> Some(collectComputationExpressionStatements expr id)
| _ -> None Because of this change, you might need to update fantomas/src/Fantomas/CodePrinter.fs Lines 1633 to 1643 in b742103
accordingly to: | Paren (lpr, e, rpr, _pr) ->
match e with
| LetOrUses _
| Sequential _ ->
sepOpenTFor lpr
+> atCurrentColumn (genExpr astContext e)
+> sepCloseTFor rpr
| _ ->
sepOpenTFor lpr
+> genExpr astContext e
+> sepCloseTFor rpr I hope this helps. |
Issue created from fantomas-online
Code
Result
Problem description
There should not be a newline added by
let! items =
.Extra information
Options
Fantomas 4.6 branch at 10/27/2021 20:15:01 - 95833f5
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: