Improved IntelliSense support for Jupyter notebooks in VS Code – Visual Studio Magazine


Improved IntelliSense support for Jupyter notebooks in VS Code

Improved IntelliSense support for Jupyter notebooks highlights September 2022 update to Python developer tools in Visual Studio Code.

This tool comes in extensions for Python (64 million installs, making it by far the most popular VS Code tool), Jupyter (nearly 45 million installs), and Pylance, the language server that provides Python-specific “intelligences” in the code editor, such as code completion, parameter suggestions, semantic highlighting, etc.

It is this latest language server tool and associated language server protocol that is responsible for the improved IntelliSense support, the development team said in a September 1 announcement post.

“IntelliSense support for Jupyter laptops with Python kernels is now much better when using Pylance, thanks to updates to the Language Server protocol to include laptop support,” said said Microsoft’s Erik De Bonte.

“Not only will you get improved auto-completion suggestions when writing Python code in notebook files, but you will also be able to take advantage of refactoring features like variable extraction, d extraction as well as automatic imports.”

Improved IntelliSense support for Jupyter notebooks in animated action
[Click on image for larger, animated GIF view.] Improved IntelliSense support for Jupyter notebooks in animated action (source: Microsoft).

Indeed, the Jupyter tool changelog shows 15 different items that mention IntelliSense.

Additionally, the team announced a new extension that also leverages the Language Server protocol – in this case, for linter support for files using the Flake8 linter – called Flake8. It joins several other extensions that provide linting (reporting programming/style errors, bugs, and suspicious builds), formatting, and code sorting functionality.

“After releasing extensions for pylint, black and isort, we are now thrilled to announce that we also have a new flake8 extension!” said DeBonte. “Just like the others, this new extension uses the Language Server protocol to provide linting support, and since it ships with the latest version of Flake8, you are no longer required to install it in a Python environment.

“You can also use it side-by-side with the Pylint extension, as one doesn’t conflict with the other.”

Additionally, many small improvements and fixes have been made in response to developer feedback, including:

  • Developers can now clear and refresh the list of Python interpreters via a new button in the selector (vscode-python#19628).
  • Debugpy has been updated to version 1.6.3 (vscode-python#19698)
  • Pylance now shows more false warnings when importing a Python module/file into a Jupyter notebook (pylance-release#3017).
  • Renaming symbols in different cells in Jupyter notebooks no longer fails when using Pylance (pylance-release#3061).
  • IntelliSense support for matplotlib has been improved when using Pylance with updates to matplotlib type stubs (python-type-stubs#223).

To understand how to use all of these tools, Microsoft provides the “Getting Started with Python in VS Code” documentation.

About the Author

David Ramel is an editor and writer for Converge360.

Comments are closed.