Open Smaug123 opened 4 years ago
Fantomas will try to format this multiple times, I believe this fails in case you don't pass any defines to the compiler.
Then you end up with:
module F =
let a : string =
let baz : unit = ()
which looks like incorrect code to me so the behaviour seems correct at first glance.
You miss at least one #else
block I think.
I agree, this is a bit of a grey area; it's possible to have an environment set up in such a way that the code will not compile. I guess this is a case where Fantomas could have done better, but perhaps it was unreasonable to expect it to.
This seems like a nice case for .fantomasignore
😅.
Issue created from fantomas-ui
This may be a known corollary of the #ifdef problems, but one more I ran across in our internal codebase.
It is perhaps reasonable to flag this as a place which might contain a syntax error under the appropriate #defines, but in this instance we were happy to assert that at least one of the #ifdefs would pass.
Code
Error
Options
Fantomas Next - 3.0.1-11/13/2019
IndentOnTryWith
false
IndentSpaceNum
4
KeepNewlineAfter
false
PageWidth
120
ReorderOpenDeclaration
false
SemicolonAtEndOfLine
false
SpaceAfterComma
false
SpaceAfterSemicolon
false
SpaceAroundDelimiter
false
SpaceBeforeArgument
false
SpaceBeforeColon
false
StrictMode
false