-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Non needed parentheses are added around lambda call from tuple/members #3082
Comments
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. |
That's what I supposed.
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 [<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 Next look in See fantomas/src/Fantomas.Core/CodePrinter.fs Line 1872 in 873d9d7
seems to add the parentheses. Commenting that out will make the test pass and make 31 others fail. |
Hi, aspiring first-time contributor here. I can confirm that the new test and all the other tests pass with the following change (except for a minor change to I would appreciate any additional test ideas. I have not submitted a pull request because I am unsure how "hacky" my change is. |
@johnW-ret please open a PR to make reviewing easier for us. Thanks! |
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: