Closed nojaf closed 1 year ago
Hey @nojaf, thanks a lot for quick fix!
IIRC, this logic is there because newline comment can be connected to node that is not the last on line, so we delay its print out to end of line.
My guess is that print out immediately can cause problems (consider for example ,
on EOL), but definitely it worth a try to see how many test it will break :)
Thanks, I might give that a shot sometime. Do you want a new release with this fix?
Do you want a new release with this fix? Yes please. Thanks!
@jindraivanek released https://github.com/fsprojects/fantomas/releases/tag/v6.0.1!
Fixes #2847.
Hey @jindraivanek,
Thanks for the report. I have a fix for this problem, but I'm not sure this will never lead to any other problems.
On a side note, we currently don't immediately print the line comment after the source. This has been the case since the inception of trivia I think. Since trivia has evolved quite a bit, what do you think of changing this mechanism? To always directly write the trivia and insert a new line? Does that sound worth exploring?