News

Visual Studio's Python IntelliSense Goes Standalone, Previews in VS Code Extension

Microsoft is converting the baked-in Python IntelliSense support in Visual Studio into an open source standalone product and previewing it in the new update to the VS Code Python extension.

Visual Studio's IntelliSense code analysis and code completion suggestions have worked with Python since the language's infusion into the IDE in 2011. Now the company has leveraged its Language Server Protocol to make that Python goodness portable in the form of the Python Language Server.

"It is available first today in the July release of the Python Extension for Visual Studio Code, and we will later release it as a standalone component that you can use with any tool that works with the Language Server Protocol," Microsoft's Steve Dower said in a post yesterday.

The Language Server Protocol defines the protocol used between a code editor or IDE and a language server that provides language features like auto complete, go to definition, find all references and so on. Through it, functionality like IntelliSense that was previously provided by complicated static analysis closely tied to specific editors or IDEs is made portable, offered up by a server rather than the editor/IDE. Thus editors/IDEs that support the protocol can get IntelliSense for any programming language it works with.

"Previously, Python IntelliSense in Visual Studio was very specific to that IDE," Dower explained. "We have been developing this support for nearly a decade. It has an impressively deep understanding of the Python language, but only Visual Studio users have been able to enjoy this work. Recently we have been refactoring our implementation to separate it from Visual Studio and make it available as a standalone program using the Language Server Protocol.

"The end result is that we have a black box that takes Python code and provides all the information your editor needs for tooltips, completions, finding definitions and references, global variable renaming and more."

As a preview available in the latest update to the VS Code Python extension, Microsoft yesterday said it provides the following benefits (already available or soon coming in Visual Studio) to VS Code developers:

  • Syntax errors as you type in code
  • Warnings when modules are not found
  • Using Typeshed files to fill in missing completions for modules
  • Improved performance for analyzing your workspace and presenting completions
  • Ability to detect syntax errors on your entire workspace, rather than just the current file
  • Faster startup times
  • Faster imports
  • Better handling for a number of language constructs

Those details were provided in a post announcing the June/July releases of the VS Code Python extension. Microsoft's Brett Cannon also announced the team has closed 156 issues in the new releases, which also incorporate gevent launch configuration for debugging.

"Contributed by Bence Nagy at the PyCon US 2018 sprints, the experimental debugger now supports a gevent launch configuration for code that has been monkey-patched by gevent," Cannon said. "A predefined debugging template named 'Python Experimental: Gevent' is available, as well as adding the setting "gevent": true to any launch configuration."

The Python extension is the most popular offering in the Visual Studio Code Marketplace. It boasts more than 13.9 million installs and has earned a 4.6 (out of 5 max) from 182 developers who reviewed it.

Dower said by making Visual Studio's Python IntelliSense portable and cross-platform, the team can improve it for both Visual Studio and VS Code at the same time. The standalone release of the Python Language Server is expected in the next few months, he said, and will be available under the Apache 2.0 license.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube