VS Code Update Boosts Python IntelliSense
Microsoft's latest update to the opens-source-based Visual Studio Code editor features a raft of minor improvements, including improved IntelliSense for the popular Pylance language server for Python coding.
Specifically, the VS Code 1.76 (February 2023) release improves IntelliSense support for pytest in the Pylance extension, which has been installed a whopping 51 million times.
The pytest framework seeks to make it easy to write small, readable tests, with the ability to scale to support complex functional testing for applications and libraries.
New pytest features include:
- Support for completions, Go to Definition, Find All References, and Rename Symbol (F2) for pytest fixtures and parameterized arguments.
- Type annotation support for pytest parameters through inlay hints (enabled by the "python.analysis.inlayHints.pytestParameters" setting) and through Code Actions.
- Type inference of parameterized pytest arguments, based on the parameter values provided to the decorator.
All that is demoed in this video:
Other highlights of the release as presented by Microsoft include:
- Profiles -- Active profile badge, quickly switch profiles via the Command Palette: Profiles, released to Stable last milestone, let you quickly switch VS Code configurations depending on your current workflow and project.
- Accessibility improvements -- New audio cues, improved terminal screen reader mode: You can listen to the available audio cue sounds by scrolling through the Help: List Audio Cues dropdown. Error audio cue responsiveness has also been improved, along with terminal accessible improvements, context-specific Tab focus mode and more.
- Moveable Explorer view -- Place the Explorer in the secondary side bar or a panel: The Explorer view container (Ctrl+Shift+E) is now moveable and can be placed into the secondary side bar or the bottom panel to allow for further workbench customization.
- Notebook kernel MRU list -- Find and select recently used notebook kernels: The kernel picker now shows the most recently used (MRU) kernel by default. This is a change from the previous behavior, which was to show all available kernels.
- Markdown header link suggestions -- Easily link to headers in files across your workspace: Workspace header completions help link to a header in another Markdown document, in case a developer doesn't remember or want to type out the full file path.
- Remote Development usability -- New keyboard shortcut, streamlined remote options list: This milestone sees several usability improvements to the remote menu, accessible by clicking on the remote indicator in the lower left of the Status bar, including:
- There is now a default keybinding to open the remote menu: Ctrl+Alt+O.
- The team reduced its remote extensions' contributions to the remote menu to make it easy to view all actions for connecting to a remote window at a glance.
- The Install Additional Remote Extensions option in the remote menu now points to a list of curated Remote Development extensions and is hidden from the remote menu if all such extensions are already installed.
- New Git/GitHub topics -- Articles for beginner and advanced Git source control users: New articles include:
- Improved Marketplace search -- Better results for multi-word queries.
- Jupyter IPyWidgets 8 support -- Use the latest IPyWidgets version in your Jupyter notebooks: The Jupyter extension now supports version 8 of IPyWidgets. Python Widgets relying on IPyWidgets 7.* will continue to work, as both versions 7.* and 8.* are supported.
Preview features, meanwhile, include:
About the Author
David Ramel is an editor and writer for Converge360.