News

Pylance Now Default Language Server for Python in Visual Studio Code

Pylance is now the default language server for Python in Visual Studio Code, providing IntelliSense functionality as of the May 2021 release of the Python Extension for VS Code.

Language servers come via extensions that implement the Language Server Protocol to provide language-specific "smarts" in the editor such as autocomplete, error-checking (diagnostics), jump-to-definition and many other language-specific features. Those extensions make the super-popular VS Code a jack-of-all-trades tool for working with C#, C++, Java and many more.

Yesterday, (May 10), Python extension dev team announced Pylance is the default language server, supplanting the Microsoft Python Language Server announced way back in 2018.

No such language server is more important to VS Coders than Pylance, as it is now bundled as an optional offering with the core Python extension that has been installed a whopping 35.5 million times, way more than any other tool.

Pylance, named after a character in a Monty Python movie, is based on a Microsoft static type checker called Pyright.

Pylance
[Click on image for larger view.] Pylance (source: VS Code Marketplance).

Pylance was announced in July 2020. A couple months later, Microsoft said, "If you are a VS Code user, we recommend that you uninstall Pyright and instead install Pylance," Microsoft says. "You will get all the benefits of Pyright and more!"

Those benefits include:

  • Docstrings
  • Signature help, with type information
  • Parameter suggestions
  • Code completion
  • Auto-imports (as well as add and remove import code actions)
  • As-you-type reporting of code errors and warnings (diagnostics)
  • Code outline
  • Code navigation
  • Type checking mode
  • Native multi-root workspace support
  • IntelliCode compatibility
  • Jupyter Notebooks compatibility
  • Semantic highlighting

"Today, we're excited to announce that the Python extension's default language support is now powered by Pylance, said Savannah Ostrowski, program manager for Python and its VS Code language server. "This upgrade provides what we believe is the most performant and user-friendly Python editing experience for Visual Studio Code ever.

"If you've been following along with our releases over the last year, we've been making dramatic improvements to Python language support via the Pylance extension. As of this release, we've included the Pylance extension as an optional dependency for the core Python extension. This means that you'll get the latest and greatest language support right out of the box with the Python extension (no separate install needed!)."

She said the dev team has been working on improving VS Code language server functionality across the board, including the open source Jedi language server, which -- along with any other language server -- can still be installed if developers prefer. Unlike Jedi, Pylance is not open source, though it does sport a GitHub repo for providing feedback and documentation. "We are committed to maintaining open-source language support options for our users in the future," Ostrowski said.

Other highlights of the release include:

  • Faster extension startup time: 10 percent faster load times for Windows and macOS users, and 20 percent faster for Linux users.
  • New debugger feature: live reload for Python scripts: "If you ever made changes to your code after the debugger execution has hit a breakpoint, and you wished those changes were applied without the need of reloading the debugger, this update is for you!"
  • Other changes and enhancements and their associated GitHub issues include:
    • Add a “Default” language server option, which dynamically chooses which language server to use. (#16157)
    • Automatically indent following "match" and "case" statements. (#16100)
    • Add Python: Refresh TensorBoard command (#16053)
    • Added compatability with pypy3.7 interpreter. (#15968)

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube