Python in Visual Studio Code – June 2023 Release

Courtney Webster

We’re excited to announce that the June 2023 release of the Python and Jupyter extensions for Visual Studio Code are now available!

This release includes the following announcements:

  • Test Discovery and Execution Rewrite
  • Run Python File in Dedicated Terminal
  • Preview: Intellisense support for overloaded operators
  • Configurable indexing limits with Pylance

If you’re interested, you can check the full list of improvements in our changelogs for the Python, Jupyter and Pylance extensions.

Test Discovery and Execution Rewrite

This month, we are beginning the roll out of our testing rewrite behind an experimental feature. This rewrite redesigns the architecture behind test discovery and execution for both unittest and pytest in the extension. While it does not provide any additional functionality exposed to the user, it provides a faster and more stable experience, and opens up new functionality opportunities moving forward. The rewrite will be rolled out behind the experimental "pythonTestAdapter" flag, which you can opt into with "python.experiments.optInto" in your settings.json. Eventually, we plan to remove the setting and adopt this new architecture. If you have any comments or suggestions regarding this experiment or rewrite, please share them in the vscode-python repo.

Run Python File in Dedicated Terminal

UPDATE (13 June 2023) – This feature has been rolled back due to a bug tracked by vscode-python#21393.

The Python extension will now create a new terminal for each file you run using the run button in the top right corner of the editor or the Python: Run Python File in Terminal command. This also means the Python extension will keep using this file’s “dedicated” terminal every time you re-run the file.

Any time you wish to run the same file in a separate terminal, you can run select Python: Run Python File in Dedicated Terminal under the run button menu.

Run python file dedicated terminal option in dropdown menu

 

Preview: IntelliSense support for overloaded operators with Pylance

Overloaded operators allow you to redefine the behavior of built-in operators for your custom objects or data types. When using the latest pre-release version of the Pylance extension, you are now able to use IntelliSense to explore and utilize overloaded operators with ease and efficiency.

This functionality provides code completion, parameter information, and signature help for overloaded operators, whether you’re working with mathematical vectors, complex numbers, or any other custom classes.

Intellisense on overeloaded operators gif

Configurable indexing limits with Pylance

There’s a new Pylance setting that allows you to configure the file count limit for indexing: "python.analysis.userFileIndexingLimit", which is set to 2000 by default. This setting can be particularly helpful when you’re working with very large projects and are willing to compromise performance for an enhanced IntelliSense experience.

Other Changes and Enhancements

We have also added small enhancements and fixed issues requested by users that should improve your experience working with Python and Jupyter Notebooks in Visual Studio Code. Some notable changes include:

  • New experimental createEnvironment.contentButton setting to disable the Create Environment button in dependency files (vscode-python#21212)
  • Detect installed packages in the selected environment (vscode-python#21231)
  • New python.analysis.inlayHints.callArgumentNames setting to enable inlay hints for call argument names with Pylance

We would also like to extend special thanks to this month’s contributors:

Try out these new improvements by downloading the Python extension and the Jupyter extension from the Marketplace, or install them directly from the extensions view in Visual Studio Code (Ctrl + Shift + X or ⌘ + ⇧ + X). You can learn more about Python support in Visual Studio Code in the documentation. If you run into any problems or have suggestions, please file an issue on the Python VS Code GitHub page.

0 comments

Discussion is closed.

Feedback usabilla icon