-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cursor jumps to bottom of file when auto-formatting on save #12128
Comments
Oh wow, thanks for the video. |
Unfortunately, I'm not able to reproduce this. Can you provide some additional details like:
I've copied the Screen.Recording.2024-07-02.at.12.58.27.movCan you also provide the output of "Ruff: Print Debug Information" command. Here's mine:
|
sorry, i completely forgot that i'm using a different version of the builtin stubs with docstrings in them, and the issue doesn't seem to occur without them. here's the version of the file i was running it on (sorry it's a in case you still aren't able to reproduce it, heres the additional info you requested: vscode: v1.90.2 ruff debug info:
|
Thank you for providing the details! I can reproduce it now. |
I think this is happening because the replacement algorithm (https://github.com/astral-sh/ruff/blob/88a4cc41f76cbb5d1318d5e689b118ec624b8d69/crates/ruff_server/src/edit/replacement.rs) is different than the one in The returned // ruff server
2024-07-03 16:26:59.123 [info] Result: [
{
"newText": "...",
"range": {
"end": {
"character": 0,
"line": 5089
},
"start": {
"character": 0,
"line": 1146
}
}
}
]
// ruff-lsp
2024-07-03 16:26:20.420 [info] Result: [
{
"range": {
"start": {
"line": 1146,
"character": 0
},
"end": {
"line": 1149,
"character": 0
}
},
"newText": ""
}
] |
this is a very strange bug that i can't seem to minify at all.
to reproduce:
ruff.nativeServer
totrue
editor.formatOnSave
totrue
(it seems to only happen reliably when formatting on save)builtins.pyi
into a random.py
file in my project)Recording.2024-07-01.115658.mp4
The text was updated successfully, but these errors were encountered: