This is a very weird combination of circumstances so not sure if it's fixable. Please look at the example below, after formatting, private loses indentation so the code doesn't compile (and in this case, it only showed up in Fable compilation with apparently unrelated errors so it was a bit difficult to spot it). The interesting part is this only happens when using both the comments between the type name and private keyword and the compiler directive. If you remove any of the two, the formatting is done correctly. Does it ring a bell? If it doesn't, don't worry too much as this will happen very rarely (though in cases like this it may be a good idea to leave the formatting of code between compiler directives untouched).
Code
type Currency =
// TODO: Temporary fix until a new Thoth.Json.Net package is released
// See https://github.com/MangelMaxime/Thoth/pull/70
#if FABLE_COMPILER
private
#endif
| Code of string
Error
type Currency = // TODO: Temporary fix until a new Thoth.Json.Net package is released
// See https://github.com/MangelMaxime/Thoth/pull/70
#if FABLE_COMPILER
private
#endif
Code of string
I'm guessing something is wrong in TokenMatcher code. Perhaps setting PreserveEndOfLine to true helps as workaround, but that might lead to other surprises 🙃
Issue created from fantomas-ui
This is a very weird combination of circumstances so not sure if it's fixable. Please look at the example below, after formatting,
private
loses indentation so the code doesn't compile (and in this case, it only showed up in Fable compilation with apparently unrelated errors so it was a bit difficult to spot it). The interesting part is this only happens when using both the comments between the type name andprivate
keyword and the compiler directive. If you remove any of the two, the formatting is done correctly. Does it ring a bell? If it doesn't, don't worry too much as this will happen very rarely (though in cases like this it may be a good idea to leave the formatting of code between compiler directives untouched).Code
Error
Options
Fantomas 2.9.1
IndentSpaceNum
4
PageWidth
80
PreserveEndOfLine
false
SemicolonAtEndOfLine
false
SpaceBeforeArgument
true
SpaceBeforeColon
true
SpaceAfterComma
true
SpaceAfterSemicolon
true
IndentOnTryWith
false
ReorderOpenDeclaration
false
SpaceAroundDelimiter
true
StrictMode
false