Editor jumps 200 lines below when formatting on save
I get the behavior with beta.5 and 1.64.0
Any change in https://github.com/DZakh/sury Sury.res which requires a formatting update.
Do you have the GitLens extension enabled? And if so, does the problem go away once you disable it and reload VS code?
One of my colleagues was having the same issue as you where his cursor would jump on save and we narrowed it down to a recent update in GitLens.
I think I do. I'll try to remove it
In F#, we solved this problem by attaching the cursor to an AST node. (Similar to how comments works)
You pass it a cursor position and get the position back after formatting. Then the editor could scroll to that position if necessary.
Still jumps. Specifically in the file https://github.com/DZakh/sury/blob/main/packages/sury/src/Sury.res
Works good after disabling the option
That is... weird.
I have 6500 lines file with almost every ReScript feature. Probably one of them causes the problem 🤔
Oh right, something is probably messing up the locs in the code lens. Feels like something that should be pretty easy to track down. Good that we have the reproduction, hopefully someone can take a look at this.