New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formatting can depend on cursor position #3007
Labels
Comments
I guess I missed something in my testing, I swear I tried to write this exact test and it didn't fail for me haha, thanks for kicking this back over. |
The strange thing here is that the formatted code is different whether a cursor was inserted or not. let formatWithCursor source (line, column) =
let x = CodeFormatter.FormatDocumentAsync(false, source, FormatConfig.Default) |> Async.RunSynchronously
let y = CodeFormatter.FormatDocumentAsync(false, source, FormatConfig.Default, CodeFormatter.MakePosition(line, column))
|> Async.RunSynchronously
// Strangely they differ
x.Code <> y.Code |
Yeah that's why I originally raised this issue, in my case it actually broke my code. |
Fix available in https://www.nuget.org/packages/fantomas/6.3.0-alpha-004 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original issue https://youtrack.jetbrains.com/issue/RIDER-102749
Reproduce via tests in the latest main branch:
The text was updated successfully, but these errors were encountered: