News

VS Code Python Devs Get 'Full' Language Server Mode for Pylance

Serving tens of millions of developers, Microsoft's dev team for Python in Visual Studio Code shipped a new release with three major new features, including a "full" language server mode for Pylance, which provides language-specific "smarts," including IntelliSense.

The other two are a preview of Python Environments and new Docstring generation features using Pylance and Copilot, with IntelliSense again figuring in.

The team oversees the Pylance extension along with a main Python extension and Jupyter, an open-source project that provides a web-based interactive computing environment notable for its Notebooks.

Python is perhaps the most important language for VS Code developers, as those three extensions top the popularity leaderboard by a huge margin and together account for a whopping 360 million installs, according to the Visual Studio Code Marketplace. Extrapolating the available data, several sources estimate that tens of millions of developers use Python in VS Code.

With that in mind, the ability to use all of the language's goodies is kind of a big deal.

However, that comes with a performance hit, explained the team in a recent update post.

"The python.analysis.languageServerMode setting now supports full mode, allowing you to take advantage of the complete range of Pylance's functionality and the most comprehensive IntelliSense experience," the team said". "It's worth noting that this comes at the cost of lower performance, as it can cause Pylance to be resource-intensive, particularly in large codebases."

The setting also adjusts the default values of several settings based on whether it is set to light, default, or full:

Light, Default or Full Settings
[Click on image for larger view.] Light, Default or Full Settings (source: Microsoft).

The team also announced a preview of a Python Environments extension, which provides a new way to manage Python environments in VS Code, creating, deleting and switching between environments. Such environments typically include the Python interpreter and any libraries or packages a dev has installed. This new tool will eventually replace the environment functionality in the main Python extension.

Environments Management in Animated Action
[Click on image for larger, animated GIF view.] Environments Management in Animated Action (source: Microsoft).

"Designed to integrate seamlessly with your preferred environment managers via various APIs, it supports Global Python interpreters, venv, and Conda out of the box," the team said. "Developers can build extensions to add support for their favorite Python environment managers and integrate with our extension UI, enhancing functionality and user experience."

Finally, the team announced new Docstring generation features using Pylance and Copilot, which provides a new way to generate docstrings for Python functions, serving to document the purpose and usage of the code they describe. Devs can now generate docstrings via IntelliSense completions, Code Actions or Copilot-powered Code Actions. You can read all about the specific details here.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

Subscribe on YouTube