Closed nojaf closed 2 years ago
Hi @dsyme, fantomas-tool was renamed to fantomas so you didn't bump to the latest version.
I see!!!! No wonder I hadn't seen the latest versions :)
Thank you!!
Were the deletions of // FSX
and // IPYNB
from #endif // FSX
conditionals intended? If I leave off // FSX
then the #endif
is left in the output .fsx file.
For example:
(***condition:fsx***)
#if FSX
let a = 4
#endif
results in an output .fsx with:
let a = 4
#endif
Is this from fantomas?
Fantomas does appear not to restore the comment after a hash directive. Sample.
They weren't intended. @nojaf Did you create a tracking issue for this in fantomas?
Fixed for this repo via a .fantomasignore entry
@dsyme, no I didn't. I'm a bit confused here, is this relevant or not? If there is meaning to the comment after the hash directive, if can't help but feel that this solution should be reviewed instead. Fixing this in Fantomas will introduce a messy solution. You want to assign a trivia to a trivia here. This little manoeuvre won't be pretty and probably introduce a performance hit for everybody. I'd like to know more before trying to address this on Fantomas' side. This feels very unorthodox, to be frank.
Hmmm, I suspect it's quite common to have clarifying comments in this position, I know I do it all the time to clarify what the #endif is closing. We should probably open a fantomas issue and discuss there even if you decide not to fix, so there's a record of it.
In this case yes, there's a meaning of sorts for the somewhat hacky pre-processing of the scripts (that however could likely be implemented in other ways)
This will be painful if we need to check this in larger files: example.
Every comment after source code that is not yet assigned should be checked against hash directives. This feels like it should be an IDE hint feature instead. I'm open to discussing this further on Fantomas' side.
Hi @dsyme,
fantomas-tool
was renamed tofantomas
so you didn't bump to the latest version.