this is a pretty simple question but I couldn't figure out the solution for this problem.
Let's say I have this simple Python code in VS Code IDE:

Let's say I want to refactor the variable "value" to be "value1", I press Fn+F2 on my computer and I edit the variable name:

This is the result of the code after the refactor step.

As you can see it adds automatically a new line without me requesting something like that.
I tried to search for a solution at Google, for example:
There was some thread at Stack Overflow which said to click "Ctrl+Shift+P" and to open the "editor" and search for the solution there but unfortunately it didn't help.
I searched at VSCode official docs but I couldn't figure how where to search for this specific problem so I kinda got lost there.
My Extentions:

The solution should be really easy but I miss something. I will be for your help, thanks! :)
Just encountered the same issue, with the same extensions installed. This appears to caused somehow by line-endings.
When using CRLF line endings I can reproduce the behaviour you've described (the option should appear in vscode at the bottom right of the window). Switching this to LF, I get refactoring working as normal.
For me the issue started when I disabled the Pylance extension.
Enabling the Pylance extension, then closing and reopening VSCode, got rid of the issue.
The role of Pylance is also mentioned in this GitHub issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With