News

Easier Jupyter Notebook Setup for Python in VS Code Tooling

In the regular monthly update to Python tooling for Visual Studio Code, Microsoft announced an improved setup experience for Jupyter notebooks, along with new inlay type hints for the Pylance language server.

The dev team for Python tooling in VS Code handles the the three most popular extensions in the VS Code Marketplace, with the main Python tool boasting a whopping 60.1 million installs, followed by Jupyter (40.8 million) and Pylance (33.4 million).

The latter, a language server that serves up language-specific "smarts" for IDEs and code editors such as jump-to-definition, find all references and so on, is improved in the July 2022 update by inlay type hints, which add inline information to code to help developers quickly understand the meaning of variables or functions.

The update added hints for two types: variables and returns.

"Return type inlay hints show the return types of functions that don't have an explicit annotation," said Luciana Abud, program manager, in a July 7 announcement. "To enable it, you can set 'python.analysis.inlayHints.functionReturnTypes': true to your user settings (Preferences: Open Settings (JSON) command).

"Similarly, variable type inlay hints show the types of variables that don't have explicit type annotations. You can enable it by setting 'python.analysis.inlayHints.variableType's: true."

Inlay Hints
[Click on image for larger view.] Inlay Hints (source: Microsoft).

While the new hints don't change any code, the team is working to provide the ability to add suggested annotations to code via code operations for inlay hints.

The other main highlight of the update affects the Jupyter notebook "getting started" experience, specifically by improving the extension recommendation flow from within a notebook when the Python or Jupyter extensions aren't installed. Now, upon opening a Jupyter notebook in VS Code, developers will see an "install suggested extensions" entry when trying to run a cell or select a kernel. Abud said this greatly reduces the number of steps needed to get the first notebook cell run.

Several other minor updates, tweaks and fixes are detailed in the announcement post.

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