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
((* comment before gets swallowed *)fun x -> x *42)(fun x -> x *42(* comment after is OK *))((* comment on first line is OK too *)fun x -> x *42)
Result
(fun x -> x *42)(fun x ->
x *42(* comment after is OK *))((* comment on first line is OK too *)fun x -> x *42)
Problem description
A comment above/before an anonymous function is getting dropped from the formatted output. This also happens if you use // for a line comment instead of the (* *) block comment syntax.
Extra information
The formatted result breaks by code.
The formatted result gives compiler warnings.
I or my company would be willing to help fix this.
Hello @naartjie, I'm in the process of writing some more 'getting started' content. See #1195.
As for this problem, it is a trivia bug.
See online tool.
Fantomas assigns the block comment to a SynExpr.Lambda node. And in CodePrinter.fs we need to call genTrivia or variant in order that the comment gets restored.
In CodePrinter I believe it is not printed around here.
Call it a gut feeling.
Issue created from fantomas-online
Code
Result
Problem description
A comment above/before an anonymous function is getting dropped from the formatted output. This also happens if you use
//
for a line comment instead of the(* *)
block comment syntax.Extra information
Options
Fantomas Master at 10/02/2020 17:06:53 - 31305c2
Default Fantomas configuration
Possibly related issues
#1179 #1172 #932
The text was updated successfully, but these errors were encountered: