Article complete

Microsoft Enhances Editing Experience With Python 2.7 In Visual Studio

Microsoft has included Pylance charged module for renaming; enhanced editing experience and updated debugging with Python 2.7.

Microsoft Enhances Editing Experience With Python 2.7 In Visual Studio

Key takeaways

  • Microsoft has released updates to the Python Extension for Visual Studio Code, enhancing editing and debugging features.
  • The Pylance module allows developers to efficiently refactor code with a preview of changes before finalising them.
  • Developers can now utilise syntax error detection and IntelliSense support in virtual or untrusted workspaces.
  • From January 2022, debugging support for Python 2.7 will be discontinued, following previous limitations on IntelliSense.

Takeaways drafted with AI from the article text.

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.

Published

Spotted an error? Tell our editors. Read our editorial standards and corrections.