Python in Visual Studio Code – June 2023 Release
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
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
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.
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.
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.contentButtonsetting to disable the Create Environment button in dependency files (vscode-python#21212)
- Detect installed packages in the selected environment (vscode-python#21231)
python.analysis.inlayHints.callArgumentNamessetting to enable inlay hints for call argument names with Pylance
We would also like to extend special thanks to this month’s contributors:
- @PeterjClaw Disable “snippers” expansion in Jedi LSP (vscode-python#21194)
- @JonathanRayner Add option for pyenv interpreters when creating environments with venv (vscode-python#21219)
- @cpinamtz Fix typo in a type declaration of MultiStepInput module (vscode-python#21156)
- @cpinamtz Insert debug configuration function on every quick pick item (vscode-python#21165)
- @cpinamtz Add more coverage to utils function (vscode-python#21026)
- @cpinamtz Remove IS_WINDOWS constant in favor of PlatformService (vscode-python#21157)
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.