Microsoft has made available the May 2021 release of the Python Extension for Visual Studio Code, making Pylance the default language server and speeding extension startup time.
The latest release of the Python Extension for Visual Studio Code was announced on the Microsoft Python Developer Blog, with the headline enhancement being that the default language support in this release is now provided by Pylance.
As a Python language server, Pylance delivers enhancements to IntelliSense, syntax highlighting, package import resolution, and various other features intended to help developers write better code faster. Pylance is powered by Pyright, Microsoft’s own static type checking tool.
This release also made the Pylance extension an optional dependency for the core Python extension, which means that a separate install is unnecessary to get the latest language support right out of the box with the Python extension, said Microsoft.
However, Microsoft was keen to stress that developers can still choose an alternative language server, such as Jedi, by uninstalling or disabling the Pylance extension at any point.
“We believe that Pylance provides the very best user experience for Python development and we hope that you’ll try it out. However, we are committed to making sure that you can configure your development environment exactly how you like it,” said Savannah Ostrowski, program manager for Python Language Server and Python in Visual Studio.
Other improvements address performance, and Microsoft claims that from this release, the Python extension will load much faster and more reliably thanks to a major improvement to the Python environment discovery mechanism.
In fact, Microsoft claims that users should see a 10 percent faster load time for Windows and MacOS, and a 20 percent boost for Linux users. The improvements have also helped to decrease the number of times the Python extension becomes unresponsive by 15 percent.
Debugging with the Python extension has also been made easier with newly added support for code reload of Python scripts. With this feature, changes will now be applied after the debugger has already started executing and has hit a breakpoint, without the need to restart the debugger, Microsoft said.
Users can download the Python extension from Visual Studio Marketplace, or install it directly from the extension gallery in Visual Studio Code. Those already using the Python extension can get the latest update by restarting Visual Studio Code.