-
-
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
Line comments after null
value used as argument in function call are removed
#1676
Comments
Hello, thank you for reporting this issue. In this specific scenario, the comments are found and assigned to a SynExpr_Null node. The problem you are facing is that the trivia is not printed in the fantomas/src/Fantomas/CodePrinter.fs Lines 2657 to 2694 in 728e31e
Are you interested in submitting a PR for this? |
I will try understanding this and working on PR – in case of any problems I will ask here. BTW: Similar issue with comment removal in pattern match: Before: match v with
| x
| y // comment
| z -> 42
| _ -> 0 After: match v with
| x
| y
| z -> 42
| _ -> 0 |
That would be the same category of problems yet there would not be one fix that would solve both problems. |
Issue created from fantomas-online
Code
Result
Problem description
Comments after
null
are removed – should be left as is, as it is for other argument types. Looks likenull
is handled specially.I was trying to find how it is handled in Fantomas' code, but clearly my fsharp-fu is not enough to grasp it, so probably can't help directly with making a PR/fix. :(
Extra information
Options
Fantomas Master at 04/17/2021 11:23:36 - 26674f9
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: