Python in Visual Studio Code – August 2020 Release

Savannah Ostrowski

Savannah

We are pleased to announce that the August release of the Python Extension for Visual Studio Code is now available. You can download the Python extension from the Marketplace, or install it directly from the extension gallery in Visual Studio Code. If you already have the Python extension installed, you can also get the latest update by restarting Visual Studio Code. You can learn more about  Python support in Visual Studio Code in the documentation.  

In this release we addressed a total of 38 issues, and it includes:  

  • Support for multiple Python interactive windows 
  • Pylance as an officially supported language server setting value 
  • Smart signature help with Pylance  

If you’re interested, you can check the full list of improvements iour changelog. 

Support for multiple Python interactive windows 

We’re excited to announce that you can now start multiple Python interactive windows with the Python extension! This was one of the most requested features on the Python in VS Code GitHub repo 

By default, every time you run the “Python: Create Python Interactive Window” command in the command palette (View Command Palette…), it will create a new interactive window in VS Code:  

Multiple interactive windows being created when running the "Python: Create Python Interactive Window" command

Code cells from Python scripts by default will still be executed in a same interactive window. However, you can now configure the Python extension to run separate files in separate interactive windows.  Just open the settings page (File Preferences Settings)search for “interactive window mode” and change the setting value to “perFile”.  

Interactive Window Monde settings options (perFile, single and multiple).

Now when you run cells from different files, they will each run on their own separate window: 

Running cells from each file into separate Python interactive windows.

If you would like to remain with the single interactive window behavior, you can set the value of the interactive window mode to “single”.  

Pylance as an officially supported language server value

This release includes support to officially add Pylance as a supported value in our python.languageServer setting. You can now set Pylance via the settings editor UI in Visual Studio Code. If you haven’t already installed Pylance, you can download it from the marketplace or simply set this value and we will prompt you to install it! If you missed the announcement about our new Pylance language server, you can read more about it here. 

Configuration options for Language Server setting (Jedi, Pylance, Microsoft, None)  

Improved signature help for overloaded functions in Pylance

Pylance has also improved how it displays signature help when you are invoking a function with multiple overrides. You can now navigate between signatures easily while Pylance bolds the appropriate active parameter.  

Smart signature help with pylance.

Other Changes and Enhancements 

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

  • Cell editing shortcuts for python interactive cells that help make doing data science work directly in Python files even more productive (thanks to @earthastronaut!). (#12414)
  • Added a command to restart the language server. (#3073) 
  • Update to the latest version of jedi (0.17.2). This adds support for Python 3.9 and fixes some bugs, but is expected to be the last release to support Python 2.7 and 3.5. (thanks Peter Law). (#13037) 

We’re constantly A/B testing new features. If you see something different that was not announced by the team, you may be part of the experiment! To see if you are part of an experiment, you can check the first lines in the Python extension output channel. If you wish to opt-out of A/B testing, you can open the user settings.json file (View Command Palette… and run Preferences: Open Settings (JSON)) and set the “python.experiments.enabled” setting to false 

Be sure to download the Python extension for Visual Studio Code now to try out the above improvements. If you run into any problems or have suggestionsplease file an issue on the Python VS Code GitHub page. 

8 comments

Leave a comment