Microsoft announced the launch of a new Python language server called Pylance that uses the language server protocol to communicate with VS Code. The name Pylance is a tribute to The Lancelot of Monty Python, the first warrior of King Arthur and the Knights of the Round Table.
Savannah Ostrowski, Visual Studio Python language server and Python program manager, said That Plancey is now available as an extension of Visual Studio Place, which “greatly improves the Python experience in Visual Studio Code.” “
As early as 2018, Microsoft’s Python team released the Python language server, introducing Visual Studio’s rich Python IntelliSense support to VS Code. Now, Microsoft says it has updated its language servers over the past few months to improve its performance and enable developers to write the best code, and that this work has resulted in a new Pylance language server.
According to the introduction, Pylance is a new language server based on Microsoft’s static type checker Pyright, which provides a high-performance development experience using type stubs (.pyi files) and lazy type inference. Pylance enhances the user’s Python IntelliSense experience with rich type information to help users write code faster and better. The Pylance extension also comes with a collection of pattern stubs for popular modules to provide fast, accurate auto-completion and type checking.
Some of the key features provided by Pylance include type information, automatic import, type check diagnostics, and multiple workspace support.
“Pyright’s type checking and language capabilities are now incorporated into a VS Code extension called Pylance, which is an officialLy supported Python language server by Microsoft,” Microsoft said.
“Pylance is designed to be used with the Python extension of VS Code. In addition to Pyright’s features, Pylance has added compatibility with several advanced features of IntelliCode for AI-assisted completion. If you’re a user of VS Code, we recommend that you uninstall Pyright and install Pylance so you’ll get all the benefits of Pyright and more. “
In addition, Microsoft warns users not to install both Pyright and Pylance, which will result in duplicate errors.
In the future, Microsoft revealed that Pylance represents a huge improvement in Python in VS Code, which the team has spent months on. The new language server provides higher performance and more functionality, and the team’s focus will shift to Pylance and continue to evolve.
In the short term, users can still continue to use the Microsoft Python language server when writing Python in VS Code. But the company’s long-term plan is to migrate all users to Pylance, eventually deprecating and removing the old language servers.
More details can be found on the official blog.