Open MangelMaxime opened 2 months ago
Hi, thanks for the report. This is one of those things where we add them because it is the safe thing to do to avoid another related problem. I would accept a PR for this if you are interested.
This is one of those things where we add them because it is the safe thing to do to avoid another related problem.
That's what I supposed.
I would accept a PR for this if you are interested.
I suppose it should be a small changes, I can give it when I have some time for it. Any pointers, to nudge me in the right direction?
Step one would be to add a new test in TupleTests.fs
:
[<Test>]
let ``maxime thing`` () =
formatSourceString
"""
func ("/health", fun a b -> "")
"""
config
|> prepend newline
|> should
equal
"""
func ("/health", fun a b -> "")
"""
Then take a look in the online tool what func ("/health", fun a b -> "")
produces (Oak tab), the tuple is stored in ExprTupleNode
.
Next look in CodePrinter.fs
where that is being processed:
See let genTupleExpr (node: ExprTupleNode)
:
seems to add the parentheses.
Commenting that out will make the test pass and make 31 others fail.
Issue created from fantomas-online
Code
Result
Problem description
Please describe here the Fantomas problem you encountered. Check out our Contribution Guidelines.
Fantomas adds non needed
()
around the lambda declaration.Extra information
Options
Fantomas main branch at 2024-04-16T07:11:28Z - 873d9d70d755f2c058f49b4712f3d22abb28dce4
Default Fantomas configuration
Did you know that you can ignore files when formatting by using a .fantomasignore file? PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.