Microsoft has announced the December 2021 release of the Python Extension for Visual Studio Code. The announcement includes a Pylance charged module for renaming; an enhanced editing experience when working with virtual or untrusted workspaces; and an update regarding debugging with Python 2.7.
Module rename with change preview: Developers can easily refactor their code using a new rename refactoring experience, via Pylance. In this release of renaming a Python file/module, Pylance will find all the instances that need to be updated and provide a preview of all the changes to be made. To customize the references to be updated, developers can toggle checkboxes at the line or file level at the preview stage before accepting the changes.
Rich Python editing experience: The Python extension offers syntax error detection and limited IntelliSense support when using virtual or untrusted workspaces via Pylance. Just like when using github.dev or vscode.dev, developers can now take advantage of a series of editing features that they might want while exploring a codebase virtually or inspecting the workspace locally while marking them trusted. These features include semantic highlighting, Syntax errors, code navigation, outline support, function signature help, contextual document highlighting and completions for built-ins, Pylance’s bundled stubs, locally defined symbols in the current file, and symbols in open files.
An update on debugging with Python 2.7: From January 2022, debugpy will no longer run-on Python 2.7. Following last September’s announcement on limited IntelliSense support for Python 2.7, this is the last release with support for debugging locally with Python 2.7. This change should impact only the local experience, and not remote debugging – attaching the debugger to remote processes running in Python 2.7 will still be supported.
Developers have to download the Python extension for Visual Studio Code to try out the above improvements from the Marketplace, or install it directly from the extension gallery in Visual Studio Code.