{"id":6941,"date":"2019-01-29T11:00:44","date_gmt":"2019-01-29T18:00:44","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/python\/?p=6941"},"modified":"2019-02-17T15:26:52","modified_gmt":"2019-02-17T22:26:52","slug":"python-in-visual-studio-code-january-2019-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-january-2019-release\/","title":{"rendered":"Python in Visual Studio Code \u2013 January 2019 Release"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>We are pleased to announce that the January 2019 release of the Python Extension for Visual Studio Code is now available. You can\u00a0<a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">download the Python extension<\/a>\u00a0from the Marketplace, or install it directly from the extension gallery in Visual Studio Code. You can learn more about\u00a0<a href=\"https:\/\/code.visualstudio.com\/docs\/languages\/python\">Python support in Visual Studio Code<\/a>\u00a0in the documentation.<\/p>\n<p>In this release we have closed a total of 62 issues, including:<\/p>\n<ul>\n<li>IPython console support in the Python Interactive window<\/li>\n<li>Support for running an entire file in the Python Interactive window<\/li>\n<li>Problems for failed tests when using pytest (thanks <a href=\"https:\/\/github.com\/SalmonMode\/\">Chris NeJame<\/a>)<\/li>\n<li>Much faster outline when using the Python Language Server<\/li>\n<\/ul>\n<p>Keep on reading to learn more!<\/p>\n<h2>IPython console support in the Python Interactive window<\/h2>\n<p>The <a href=\"https:\/\/devblogs.microsoft.com\/python\/2018\/11\/08\/python-in-visual-studio-code-october-2018-release\/\">data science experience was first introduced in the last October release<\/a>, and one of the top feedback requests we\u2019ve heard was to provide the ability to iterate rapidly by experimenting with code in an interactive console environment. In this update, we extended the Python Interactive window with IPython console support by allowing code to be typed in and executed directly in the window. You can now use the enhanced Interactive window standalone as an IPython console, or send code from the editor for execution.<\/p>\n<p>Here\u2019s how to use it in a nutshell:<\/p>\n<ul>\n<li>To get started, run the command <strong>Python: Show Python Interactive window<\/strong> in the Command Palette (<strong>View -&gt; Command Palette<\/strong>).<\/li>\n<li>Directly type in code, press \u201c<strong>Enter<\/strong>\u201d for a new line, and \u201c<strong>Shift-enter<\/strong>\u201d to run the code.<img decoding=\"async\" class=\"wp-image-6945 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2019\/02\/1_RunFile-1.gif\" alt=\"\" width=\"1357\" height=\"878\" \/>\n<h2>Run an entire file in the Python Interactive window without cells defined<\/h2>\n<p>Being able to run code in the Python Interactive window without having to define cells is no doubt one of the most requested features. This update enables running the entire files in the Interactive window without cell definitions.<\/p>\n<p>To run the entire file, simply use the command<strong> Run Current File in Python Interactive<\/strong> <strong>window<\/strong> in the Command Palette. Your code will be executed with results displayed in the Python Interactive window.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-6946 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2019\/02\/2_RunFile_2.png\" alt=\"\" width=\"1356\" height=\"827\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2019\/02\/2_RunFile_2.png 2181w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2019\/02\/2_RunFile_2-300x183.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2019\/02\/2_RunFile_2-768x469.png 768w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2019\/02\/2_RunFile_2-1024x625.png 1024w\" sizes=\"(max-width: 1356px) 100vw, 1356px\" \/>We\u2019ve also heard requests to run the current code selection \/ line in the editor, and this will be coming next in a future update.<\/p>\n<h2>Diagnostics for failed tests with pytest<\/h2>\n<p>This release also includes an enhancement to unit tests run with pytest: you can now see failed tests in the problems window. You can also double click lines to navigate to the failed test method and the exact failing line. The correspondent line in the editor will be selected, allowing you to easily identify and edit it.<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-6943 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2019\/02\/3_PyTestProblemWindow.gif\" alt=\"\" width=\"656\" height=\"660\" \/>As before, you can also see failed tests highlighted with pass\/fail icons in the editor. You can hover these icons to see the errors navigate to the failing test method\/line, just like in the problems window.<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-6944 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2019\/02\/4_PyTest_Code.gif\" alt=\"\" width=\"642\" height=\"378\" \/><\/p>\n<h2>Much faster outline view with the Python Language Server<\/h2>\n<p>We also made improvements to the outline view when using the Microsoft Python Language Server. The Outline view could often take a long time to load or even time out, and now with the Language Server It now loads consistently fast, and cases where symbols would appear duplicated were fixed.<img decoding=\"async\" class=\"size-full wp-image-6947 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2019\/02\/5_PyTest_Outline.png\" alt=\"\" width=\"282\" height=\"512\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2019\/02\/5_PyTest_Outline.png 282w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2019\/02\/5_PyTest_Outline-165x300.png 165w\" sizes=\"(max-width: 282px) 100vw, 282px\" \/>As a reminder, the Language Server was released as a preview the last <a href=\"https:\/\/devblogs.microsoft.com\/python\/2018\/07\/18\/python-in-visual-studio-code-june-july-2018-release\/\">July release of the Python extension<\/a>. To opt-in to the language server, change the <strong>python.jediEnabled<\/strong> setting to <strong>false<\/strong> in <strong>File &gt; Preferences &gt; User Settings<\/strong>. We are working towards making the language server the default in future releases.<\/p>\n<h2>Other Changes and Enhancements<\/h2>\n<p>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\u00a0<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/blob\/master\/CHANGELOG.md\">changelog<\/a>; some notable changes include:<\/p>\n<ul>\n<li>Add the python.pipenvPath config setting (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/978\">#978<\/a>)<\/li>\n<li>Improvements to automatic selection of the python interpreter. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/3369\">#3369<\/a>)<\/li>\n<li>Indent on enter after line continuations. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/3284\">#3284<\/a>)<\/li>\n<li>Activate pipenv environments in the shell using the command pipenv shell. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/2855\">#2855<\/a>)<\/li>\n<li>Fix bug affecting multiple linters used in a workspace. (thanks <a href=\"https:\/\/github.com\/nullie\">Ilia Novoselov<\/a>) (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/2571\">#2571<\/a>)<\/li>\n<li>Validate Mac Interpreters in the background. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/3908\">#3908<\/a>)<\/li>\n<li>Activate any selected Python Environment when running unit tests. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/3330\">#3330<\/a>)<\/li>\n<li>Use Pylint message names instead of codes (thanks to <a href=\"https:\/\/github.com\/RomanKornev\/\">Roman Kornev<\/a>) (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/2906\">#2906<\/a>)<\/li>\n<\/ul>\n<p>Be sure to\u00a0<a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">download the Python extension<\/a>\u00a0for Visual Studio Code now to try out the above improvements. If you run into any problems, please file an issue on the\u00a0<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\">Python VS Code GitHub<\/a>\u00a0page.<\/p>\n<p>&nbsp;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We are pleased to announce that the January 2019 release of the Python Extension for Visual Studio Code is now available. In this release we have closed a total of 62 issues, including IPython console support and the ability to run an entire file in the Python Interactive window, visualization and navigation to failed pytest tests from the problems window (thanks Chris NeJame), as well as a much faster outline when using the Python Language Server. Keep on reading to learn more!<\/p>\n","protected":false},"author":1064,"featured_media":6929,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-6941","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio-code"],"acf":[],"blog_post_summary":"<p>We are pleased to announce that the January 2019 release of the Python Extension for Visual Studio Code is now available. In this release we have closed a total of 62 issues, including IPython console support and the ability to run an entire file in the Python Interactive window, visualization and navigation to failed pytest tests from the problems window (thanks Chris NeJame), as well as a much faster outline when using the Python Language Server. Keep on reading to learn more!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/6941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/users\/1064"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/comments?post=6941"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/6941\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media\/6929"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media?parent=6941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/categories?post=6941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/tags?post=6941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}