July 18th, 2018

Python in Visual Studio Code – June & July 2018 Release

Brett Cannon
Principal Software Engineering Manager

We are pleased to announce that the June & July 2018 releases of the Python Extension for Visual Studio Code is now available from the marketplace and the gallery. You can download the Python extension from the marketplace, or install it directly from the extension gallery within Visual Studio Code. You can learn more about Python support in Visual Studio Code in the VS Code documentation.

Between these two releases we have closed a total of 156 issues including introducing a new experimental language server and gevent support in our experimental debugger.

Preview of Python language server

We are pleased to make available an opt-in preview of the Microsoft Python Language Server in Visual Studio Code. The language server is the IntelliSense engine from Visual Studio that implements the language server protocol, and brings the following benefits to Visual Studio Code developers.

  • Syntax errors as you type in code:

  • Warnings when modules are not found:

  • Using Typeshed files to fill in missing completions for modules
  • Improved performance for analyzing your workspace and presenting completions
  • Ability to detect syntax errors on your entire workspace, rather than just the current file.
  • Faster startup times
  • Faster imports
  • Better handling for a number of language constructs

To try out the new language server, go to File > Preferences > Settings and add the following option:

"python.jediEnabled": false

This will trigger a notification asking you to reload Visual Studio Code. Upon reload it will begin downloading the language server for your operating system. Our meta issue for the language server goes into more details of the install process as well as provides an FAQ for troubleshooting issues.

After some time using the language server you will see a prompt to fill out a survey, so please let us know how it works for you.

gevent launch configuration for debugging

Contributed by Bence Nagy at the PyCon US 2018 sprints, the experimental debugger now supports a gevent launch configuration for code that has been monkey-patched by gevent. A predefined debugging template named “Python Experimental: Gevent” is available, as well as adding the setting "gevent": true to any launch configuration.

Various Fixes and Enhancements

We have also added small enhancements and fixed issues requested by users that should improve your experience working with Python in Visual Studio Code. The full list of improvements is listed in our changelog, some notable improvements are:

  • Changed the keyboard shortcut for Run Selection/Line in Python Terminal to Shift+Enter. (#1875)
  • Changed the keyboard shortcut for Run Selection/Line in Python Terminal to not interfere with the Find/Replace dialog box. (#2068)
  • Added a setting to control automatic test discovery on save, python.unitTest.autoTestDiscoverOnSaveEnabled. (thanks Lingyu Li) (#1037)
  • Ensured navigation to definitions follows imports and is transparent to decoration. (thanks Peter Law) (#1638)
  • Fix to display all interpreters in the interpreter list when a workspace contains a Pipfile. (#1800)
  • Automatically add path mappings for remote debugging when attaching to the localhost. (#1829)
  • Add support for the "source.organizeImports" setting for "editor.codeActionsOnSave" (thanks Nathan Gaberel)

Be sure to download the Python extension for VS Code now to try out the above improvements. If you run into any issues be sure to file an issue on the Python VS Code GitHub page.

Author

Brett Cannon
Principal Software Engineering Manager

Dev lead on the Python extension for Visual Studio Code. Python core developer since April 2003.

0 comments

Discussion are closed.