{"id":8528,"date":"2021-06-17T07:35:36","date_gmt":"2021-06-17T15:35:36","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/python\/?p=8528"},"modified":"2021-06-17T07:35:36","modified_gmt":"2021-06-17T15:35:36","slug":"python-in-visual-studio-code-june-2021-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-june-2021-release\/","title":{"rendered":"Python in Visual Studio Code \u2013 June 2021 Release"},"content":{"rendered":"<p>We are pleased to announce that the June 2021 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> from the Marketplace, or install it directly from the Extensions View 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 <a href=\"https:\/\/code.visualstudio.com\/docs\/python\/python-tutorial\">Python support in Visual Studio Code<\/a> in the documentation.<\/p>\n<p>This release includes support for <a href=\"https:\/\/code.visualstudio.com\/updates\/v1_57#_workspace-trust\">VS Code\u2019s Workspace Trust<\/a>, Jump-To-Source code with the PyTorch Profiler and completions for dictionary keys with Pylance.<\/p>\n<p>If you\u2019re interested, you can check the full list of improvements in our <a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/blob\/master\/CHANGELOG.md\">changelog<\/a>.<\/p>\n<h2>Workspace Trust<\/h2>\n<p>The newest release of VS Code introduced a Workspace Trust feature, that allows you to decide if you trust the project folders you open it in VS Code or not. If you don\u2019t trust a folder or workspace, you are still able to browse your files in restricted mode.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021WorkspaceTrust.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8532\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021WorkspaceTrust.png\" alt=\"Workspace Trust window in VS Code\" width=\"1191\" height=\"809\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021WorkspaceTrust.png 1191w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021WorkspaceTrust-300x204.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021WorkspaceTrust-1024x696.png 1024w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021WorkspaceTrust-768x522.png 768w\" sizes=\"(max-width: 1191px) 100vw, 1191px\" \/><\/a><\/p>\n<p>When in a trusted workspace, the Python extension will automatically search for Python environments in your machine so you can select one for your project, and it will provide all of its features such as auto completions, code navigation, linting, formatting, testing, etc.<\/p>\n<p>When opening folders that you don\u2019t trust, you can browse the files in restricted mode. In this case, the Python extension will not load \u2013 and that is to prevent automatic, potentially malicious code execution.<\/p>\n<p>Because you can always enable trust later, we recommend you open folders in restricted mode when in doubt. That way you can always inspect the files and content in the folder before you make a decision.<\/p>\n<p>To manage Workspace Trust, you can run the \u201cWorkspace: Manage Workspace Trust\u201d command in the command palette (<strong>View &gt; Command Palette\u2026<\/strong>).<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021ManageWorkspaceTrust.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8533\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021ManageWorkspaceTrust.png\" alt=\"Workspace trust management window in VS Code\" width=\"1838\" height=\"1086\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021ManageWorkspaceTrust.png 1838w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021ManageWorkspaceTrust-300x177.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021ManageWorkspaceTrust-1024x605.png 1024w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021ManageWorkspaceTrust-768x454.png 768w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021ManageWorkspaceTrust-1536x908.png 1536w\" sizes=\"(max-width: 1838px) 100vw, 1838px\" \/><\/a><\/p>\n<p>Out of an abundance of caution, we strongly advise you to upgrade VS Code to version 1.57 for the protections provided by workspace trust. You can learn more about the Workspace Trust feature in the <a href=\"https:\/\/code.visualstudio.com\/docs\/editor\/workspace-trust\">documentation<\/a>.<\/p>\n<h2>PyTorch Profiler Jump-To-Source Code<\/h2>\n<p>One of the great benefits of having both TensorBoard and the PyTorch Profiler integrated directly in VS Code is having both your code and data science productivity tooling in the same space.<\/p>\n<p>With the latest release of the Python extension, along with the latest <a href=\"https:\/\/pypi.org\/project\/torch-tb-profiler\/\">PyTorch Profiling Plugin 0.2.0<\/a>, we\u2019ve added the ability to directly jump back to the source code (file and line) from the profiler stack traces.\u00a0 When you click on a stack trace from the PyTorch Profiler, VS Code will automatically open the corresponding file side by side and highlight\/focus directly on the line of code of interest. This allows you to quickly make actionable optimizations and changes to your code based on the Profiler results and suggestions.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021JumpToSourceSmaller.gif\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8534\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021JumpToSourceSmaller.gif\" alt=\"Jumping to source from Tensorboard in VS Code\" width=\"1500\" height=\"822\" \/><\/a><\/p>\n<h2>Completions for Dictionary Keys with Pylance<\/h2>\n<p>As of this release, Pylance now supports dictionary key completions. These completions will be provided for dictionaries created using dict() or literal syntax, {}.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021-PylanceDictionaryKeyCompletions.gif\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8536\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2021\/06\/June2021-PylanceDictionaryKeyCompletions.gif\" alt=\"Auto completions for dictionary keys with Pylance in VS Code\" width=\"1500\" height=\"750\" \/><\/a><\/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. Some notable changes include:<\/p>\n<ol>\n<li>The Jupyter extension is now an optional dependency, which means you can keep using the Python extension if you uninstall or disable the Jupyter one. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/16102\">#16102<\/a>)<\/li>\n<li>Fix for bandit linter bug where messages weren&#8217;t being propagated to the editor. (thanks <a href=\"https:\/\/github.com\/tonybaloney\">Anthony Shaw<\/a>) (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/15561\">#15561<\/a>)<\/li>\n<li>Fix for bug causing blank TensorBoard panes on Windows. (<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/issues\/16072\">#16072<\/a>)<\/li>\n<li>Enable controlled rollout for deprecating python.pythonPath and adding python.defaultInterpreterPath to the workspace level.\u00a0 (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/2125\">#2125<\/a>).<\/li>\n<\/ol>\n<p>Be sure to <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">download the Python extension<\/a> for Visual Studio Code now to try out the above improvements. 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 <a href=\"https:\/\/github.com\/Microsoft\/vscode-python\">Python VS Code GitHub<\/a>\u00a0page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are pleased to announce that the June 2021 release of the Python Extension for Visual Studio Code is now available. You can\u00a0download the Python extension from the Marketplace, or install it directly from the Extensions View in Visual Studio Code. If you already have the Python extension installed, you can also get the latest [&hellip;]<\/p>\n","protected":false},"author":1064,"featured_media":8534,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,6],"tags":[],"class_list":["post-8528","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-visual-studio-code"],"acf":[],"blog_post_summary":"<p>We are pleased to announce that the June 2021 release of the Python Extension for Visual Studio Code is now available. You can\u00a0download the Python extension from the Marketplace, or install it directly from the Extensions View in Visual Studio Code. If you already have the Python extension installed, you can also get the latest [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/8528","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=8528"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/8528\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media\/8534"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media?parent=8528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/categories?post=8528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/tags?post=8528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}