You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe here the Fantomas problem you encountered.
Check out our Contribution Guidelines.
Fantomas adds non needed () around the lambda declaration.
Note
This does not happen if you have a multi line lambda
func ("/health", fun a b ->
// Force new line
"")
Extra information
The formatted result breaks my code.
The formatted result gives compiler warnings.
I or my company would be willing to help fix this.
I would like a release if this problem is solved.
Options
Fantomas main branch at 2024-04-16T07:11:28Z - 873d9d7
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.
The text was updated successfully, but these errors were encountered:
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.
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:
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.Note
This does not happen if you have a multi line lambda
Extra information
Options
Fantomas main branch at 2024-04-16T07:11:28Z - 873d9d7
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.
The text was updated successfully, but these errors were encountered: