{"id":8820,"date":"2022-02-03T12:38:23","date_gmt":"2022-02-03T20:38:23","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/python\/?p=8820"},"modified":"2022-02-03T12:38:23","modified_gmt":"2022-02-03T20:38:23","slug":"python-in-visual-studio-code-february-2022-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-february-2022-release\/","title":{"rendered":"Python in Visual Studio Code \u2013 February 2022 Release"},"content":{"rendered":"<p><span style=\"font-size: 12pt;\">We are pleased to announce that the February 2022 release of the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">Python Extension<\/a> for <a href=\"https:\/\/code.visualstudio.com\/\">Visual Studio Code<\/a> is now available. This release includes:<\/span><\/p>\n<ul>\n<li><span style=\"font-size: 12pt;\">Smart Selection<\/span><\/li>\n<li><span style=\"font-size: 12pt;\">Folding support<\/span><\/li>\n<li><span style=\"font-size: 12pt;\">Improvements to the Python interpreters list<\/span><\/li>\n<li><span style=\"font-size: 12pt;\">Improvements when using Anaconda<\/span><\/li>\n<\/ul>\n<p><span style=\"font-size: 12pt;\">If you\u2019re interested, you can check the list of improvements in our <a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/blob\/master\/CHANGELOG.md\">changelog<\/a>.<\/span><\/p>\n<h2>Smart Selection<\/h2>\n<p><span style=\"font-size: 12pt;\"><span style=\"font-family: 'Segoe UI'; color: #444444; background: white;\">Selecting Python code using the keyboard takes fewer key presses now thanks to Smart Selection via <\/span>Pylance. This was a <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/6669\">highly requested feature<\/a>, and it takes into account your code structure and heuristics to define the selection range. You can expand your code selection with <code>Shift + Alt + Right Arrow<\/code> or <code>\u21e7 + \u2325 + Right Arrow<\/code>, and shrink it with <code>Shift + Alt + Left Arrow<\/code> or <code>\u21e7 + \u2325 + Left Arrow<\/code>.<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/02\/Feb2022-SmartSelection-HC.gif\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8821\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/02\/Feb2022-SmartSelection-HC.gif\" alt=\"Expanding and shrinking code selection with keyboard short keys for smart selection. \" width=\"1904\" height=\"1226\" \/><\/a><em>Theme: <\/em><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=DataByne.theme-monokai-hc\"><em>Monokai &#8211; High Contrast<\/em><\/a><\/p>\n<h2>Folding support<\/h2>\n<p><span style=\"font-size: 12pt;\">We\u2019ve also made improvements to <a href=\"https:\/\/code.visualstudio.com\/docs\/editor\/codebasics#_folding\">folding<\/a> support via Pylance. Previously, the folding regions were defined just by indentation, which was not ideal for some cases, for example, with multi-line strings as pointed out <a href=\"https:\/\/github.com\/microsoft\/pylance-release\/issues\/372#issuecomment-853870592\">in our issue tracker<\/a>. Now folding regions take into account semantic information appropriately (this includes #region comments).<\/span><\/p>\n<p><span style=\"font-size: 12pt;\">You can fold regions of source code using the folding icons on the gutter between line numbers and line start. Move the mouse over the gutter and click to fold and unfold regions. Use <code>Shift + Click<\/code> or <code>\u21e7 + Click<\/code> on the folding icon to fold or unfold the region and all regions inside.<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/02\/Feb2022-Folding.gif\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8822\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/02\/Feb2022-Folding.gif\" alt=\"Folding and expanding sections of code in the editor \" width=\"1852\" height=\"1174\" \/><\/a><em>Theme: <\/em><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=LanceWilhelm.horizon-extended\"><em>Horizon Extended<\/em><\/a><\/p>\n<h2>Improvements to the Python interpreters list<\/h2>\n<p><span style=\"font-size: 12pt;\">Similarly to <a href=\"https:\/\/code.visualstudio.com\/updates\/v1_62#_jupyter\">how kernels are display in the Jupyter extension<\/a>, the Python extension\u2019s interpreters list now displays Python interpreters grouped by type to make it easier to identify them:<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/02\/Feb2022-InterpreterGrouping.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8823\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/02\/Feb2022-InterpreterGrouping.png\" alt=\"List of interpreters grouped by type: workspace, venv, conda, pyenv and global.\" width=\"1524\" height=\"835\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/02\/Feb2022-InterpreterGrouping.png 1524w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/02\/Feb2022-InterpreterGrouping-300x164.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/02\/Feb2022-InterpreterGrouping-1024x561.png 1024w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/02\/Feb2022-InterpreterGrouping-768x421.png 768w\" sizes=\"(max-width: 1524px) 100vw, 1524px\" \/><\/a><\/p>\n<h2>Improvements when using Anaconda<\/h2>\n<p><span style=\"font-size: 12pt;\">This release includes several improvements to the experience when using Anaconda environments. Previously, there would be issues when debugging files and running tools using conda environments unless VS Code was initiated in an activated conda environment. To resolve several of these issues (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/5559\">#5559<\/a>, <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/11205\">#11205<\/a>, <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/11638\">#11638<\/a>), the Python extension is using \u201cconda run\u201d to execute files and tools.<\/span><\/p>\n<p><span style=\"font-size: 12pt;\">There are known issues when there are special characters in file paths, or when using custom command lines arguments in VS Code (although the Anaconda team is <a href=\"https:\/\/github.com\/conda\/conda\/issues\/10972\">already working on fixing it<\/a>). If you experience any of these issues, we recommend you check to see if conda has been released with a fix, otherwise start VS Code (\u201ccode .\u201d command) from an activated conda environment from an external terminal.<\/span><\/p>\n<h2>Other Changes and Enhancements<\/h2>\n<p><span style=\"font-size: 12pt;\">We have also added small enhancements and fixed issues requested by users that should improve your experience working with Python in Visual Studio Code. Some notable changes include:<\/span><\/p>\n<ul>\n<li><span style=\"font-size: 12pt;\">Improve select folder quickpick UI in multiroot workspaces. (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/18256\">#18256<\/a>)<\/span><\/li>\n<li><span style=\"font-size: 12pt;\">Drop support for Python 3.6 (as it reached\u00a0end-of-life in December). (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/18272\">#18272<\/a>)<\/span><\/li>\n<\/ul>\n<p><span style=\"font-size: 12pt;\">We would also like to extend special thanks to this month\u2019s contributors:<\/span><\/p>\n<ul>\n<li><span style=\"font-size: 12pt;\"><a href=\"https:\/\/github.com\/cdce8p\">Marc Mueller<\/a>: Add support for pylint error ranges. Requires Python 3.8 and pylint 2.12.2 or higher. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/18068\">#18068<\/a>)<\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><a href=\"https:\/\/github.com\/ted1030\">ted1030<\/a>: Update Chinese &#8211; Taiwan (zh-tw) translations. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/17991\">#17991<\/a>)<\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><a href=\"https:\/\/github.com\/kini\">Keshav Kini<\/a>: Improve unit tests for envVarsService. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/17747\">#17747<\/a>)<\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><a href=\"https:\/\/github.com\/Harry-Hopkinson\">Harry-Hopkinson<\/a>: Fixed typescript and namespace errors. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/18345\">#18345<\/a>)<\/span><\/li>\n<\/ul>\n<p><span style=\"font-size: 12pt;\">Try out these new improvements by <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">downloading the Python extension<\/a> from the Marketplace, or install it directly from the extensions view in Visual Studio Code (<code>Ctrl + Shift + X<\/code> or <code>\u2318 + \u21e7 + X<\/code>). You can learn more about <a href=\"https:\/\/code.visualstudio.com\/docs\/python\/python-tutorial\">Python support in Visual Studio Code<\/a>\u00a0in the documentation. If you run into any problems or have suggestions, <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/new\/choose\">please file an issue<\/a> on the\u00a0<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\">Python VS Code GitHub<\/a>\u00a0page.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are happy to announce that the February 2022 release of the Python Extension for Visual Studio Code is now available! This release includes smart selection, better folding support, improvements to the Python interpreters list and when using Anaconda. Keep on reading to learn more!<\/p>\n","protected":false},"author":1064,"featured_media":8821,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,6],"tags":[],"class_list":["post-8820","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-visual-studio-code"],"acf":[],"blog_post_summary":"<p>We are happy to announce that the February 2022 release of the Python Extension for Visual Studio Code is now available! This release includes smart selection, better folding support, improvements to the Python interpreters list and when using Anaconda. Keep on reading to learn more!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/8820","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=8820"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/8820\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media\/8821"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media?parent=8820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/categories?post=8820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/tags?post=8820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}