Closed DedSec256 closed 7 months ago
Thanks for the report Alex! We'll take a look at it in the coming days.
So, this is a lexer problem, reported https://github.com/dotnet/fsharp/issues/16418.
While we wait for the compiler to fix the range issue here, would it be feasible to calculate the correct range based on the source text & e.g. taking the number of $
and just generating our own, more correct range that way? Or would you expect that to be too error prone? Depending on how long we'll need to wait for that fix, it may be worth just monkey-patching this in the meantime. Otherwise I'd be happy to take a stab at trying to fix it in the lexer, though I worry I may be fighting an uphill battle if you and other core contributors already took a stab and couldn't figure it out 😅
You will wait forever if you expect someone else to fix the compiler. The team isn't going to pick this up, so I would suggest you take a stab at fixing this problem in the lexer.
Issue created from fantomas-online
Code
Result
Problem description
Fantomas eats braces
Options
Fantomas main branch at 2023-12-06T16:47:58Z - 0f8ee237a452f3772afe7989e031b5f65ba389f5
Default Fantomas configuration
Did you know that you can ignore files when formatting by using a .fantomasignore file? PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.