Pycharm provides:
Move functions/classes/variables from one file to another via
refactor > Move
(f6-keyboard shortcut)
Import missing imports in the current file
Is the same available in vscode? I tried searching and came across a pull request for auto import here. Couldn't find anything on move refactoring though.
Is it currently possible to do so in vscode via any extensions etc?
Visual Studio Code supports refactoring operations (refactorings) such as Extract Method and Extract Variable to improve your code base from within your editor.
You can also move file with using console (for example PowerShell or Git Bash) in Code. Recently I have I habit to move files or folders in sidebar, via ctrl + x (cut) and ctrl + v (paste), after this action Code automatically updates imports. Drag & drop method also works.
The first is not available in the Python extension for VS Code and the latter is a feature request. If you would like to see auto imports implemented, please go to that issue and upvote it.
Auto-Import for (new) missing imports is now available with PyLance.
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