{"id":8981,"date":"2022-07-07T15:25:07","date_gmt":"2022-07-07T23:25:07","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/python\/?p=8981"},"modified":"2022-07-08T14:40:22","modified_gmt":"2022-07-08T22:40:22","slug":"python-in-visual-studio-code-july-2022-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-july-2022-release\/","title":{"rendered":"Python in Visual Studio Code \u2013 July 2022 Release"},"content":{"rendered":"<p>We\u2019re excited to announce that the July 2022 release of the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">Python<\/a> and <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-toolsai.jupyter\">Jupyter<\/a> extensions for Visual Studio Code are now available.<\/p>\n<p>This release includes inlay type hints with <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.vscode-pylance\">Pylance<\/a> and improvements to the setup experience with Jupyter notebooks. If you\u2019re interested, you can check the full list of improvements in our changelogs for the <a href=\"https:\/\/github.com\/Microsoft\/vscode-python\/blob\/master\/CHANGELOG.md\">Python<\/a>, <a href=\"https:\/\/github.com\/microsoft\/vscode-jupyter\/blob\/main\/CHANGELOG.md\">Jupyter<\/a> and <a href=\"https:\/\/github.com\/microsoft\/pylance-release\/blob\/main\/CHANGELOG.md\">Pylance<\/a> extensions.<\/p>\n<h2>Inlay Type Hints<\/h2>\n<p>Inlay hints add inline information to your code in the editor to help you understand the meaning of a variable or a function at a glance.<\/p>\n<p>In this release, we have added two types of inlay hints when using <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.vscode-pylance\">Pylance<\/a>: for variable types and for return types.<\/p>\n<p>Return type inlay hints\u00a0show the return types of functions that don&#8217;t have an explicit annotation. To enable it, you can set &#8220;python.analysis.inlayHints.functionReturnTypes&#8221;: true to your user settings (<strong>Preferences: Open Settings (JSON)<\/strong> command).<\/p>\n<p>Similarly, variable type inlay hints show the types of variables that don\u2019t have explicit type annotations. You can enable it by setting &#8220;python.analysis.inlayHints.variableTypes&#8221;: true.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InlayHints2-1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8985\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InlayHints2-1.png\" alt=\"Type hint information displayed next to variables and functions in VS Code\" width=\"1877\" height=\"1171\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InlayHints2-1.png 1877w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InlayHints2-1-300x187.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InlayHints2-1-1024x639.png 1024w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InlayHints2-1-768x479.png 768w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InlayHints2-1-1536x958.png 1536w\" sizes=\"(max-width: 1877px) 100vw, 1877px\" \/><\/a><em>Theme: <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=LanceWilhelm.horizon-extended\">Horizon Extended<\/a><\/em><\/p>\n<p>It\u2019s worth noting these hints don\u2019t cause changes to your code, they only add information to the editor\u2019s user interface. However, we are working on adding <a href=\"https:\/\/github.com\/microsoft\/pylance-release\/issues\/2970\">support for adding the suggested annotations to your code<\/a>, so stay tuned!<\/p>\n<h2>Improvements to the setup experience with Jupyter notebooks<\/h2>\n<p>We have improved the extension recommendation flow from within a notebook to help improve the getting started experience when you don\u2019t have the Python or Jupyter extensions installed. Once you open a Jupyter notebook in VS Code, you will see a \u201cinstall suggested extensions\u201d entry when you try to run a cell or select a kernel:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InstallJupyterPythonSuggestions.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8986\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InstallJupyterPythonSuggestions.png\" alt=\"Option to install suggested extensions (Python and Jupyter) when clicking on select kernel or run cell buttons.\" width=\"1382\" height=\"195\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InstallJupyterPythonSuggestions.png 1382w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InstallJupyterPythonSuggestions-300x42.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InstallJupyterPythonSuggestions-1024x144.png 1024w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2022\/07\/July2022-InstallJupyterPythonSuggestions-768x108.png 768w\" sizes=\"(max-width: 1382px) 100vw, 1382px\" \/><\/a><\/p>\n<p>This change greatly reduces the number of steps needed to get the first notebook cell run within VS Code.<\/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 and Jupyter Notebooks in Visual Studio Code. Some notable changes include:<\/p>\n<ul>\n<li>We added a warning indication for conda envs lacking an interpreter with a valid python binary (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/18934\">vscode-python#18934<\/a>).<\/li>\n<li>The &#8211;user flag is no longer used when installing tools in a virtual environment (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/14327\">vscode-python#14327<\/a>).<\/li>\n<li>We resolved a number of\u00a0IPyWidgetissues related to loading of resources (images, scripts, etc.) in the Jupyter extension, improving support for widgets such as\u00a0<a href=\"https:\/\/github.com\/vegafusion\/vegafusion\">VegaFusion<\/a>,\u00a0<a href=\"https:\/\/ipyleaflet.readthedocs.io\/en\/latest\/index.html\">ipyleaflet<\/a>,\u00a0<a href=\"https:\/\/github.com\/lab-cosmo\/chemiscope\">Chemiscope<\/a>,\u00a0<a href=\"https:\/\/github.com\/takluyver\/mobilechelonian\">mobilechelonian<\/a>, and\u00a0<a href=\"https:\/\/github.com\/gkvoelkl\/ipython-turtle-widget\">ipyturtle<\/a> (<a href=\"https:\/\/github.com\/microsoft\/vscode-jupyter\/pull\/10459\">vscode-jupyter#10459<\/a>).<\/li>\n<li>We added new features to the web version of the\u00a0<a href=\"https:\/\/marketplace.visualstudio.com\/itemdetails?itemName=ms-toolsai.jupyter\">Jupyter<\/a> extension:\n<ul>\n<li>Exporting Interactive Window (<a href=\"https:\/\/github.com\/Microsoft\/vscode-jupyter\/issues\/10291\">vscode-jupyter#10291<\/a>)<\/li>\n<li>Debugging Interactive Window<\/li>\n<li>Collapsible cells in Interactive Window (<a href=\"https:\/\/github.com\/Microsoft\/vscode-jupyter\/issues\/10524\">vscode-jupyter#10524<\/a>)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\"><\/li>\n<\/ul>\n<p>We would like to extend special thanks to this month\u2019s contributors:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/Lakshmikanth2001\">Lakshmikanth2001<\/a>: Add\u00a0breakpoint\u00a0support for\u00a0django-html\u00a0&amp;\u00a0django-txt\u00a0( <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/19288\">vscode-python#19288<\/a>).<\/li>\n<li><a href=\"https:\/\/github.com\/ksy7588\">ksy7588<\/a>: Fix\u00a0unittest\u00a0discovery issue with experimental component (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/19324\">vscode-python#19324<\/a>).<\/li>\n<li><a href=\"https:\/\/github.com\/usta\">usta<\/a>: Fix variable name for\u00a0flake8Path&#8217;s description (<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/19313\">vscode-python#19313<\/a>).<\/li>\n<li><a href=\"https:\/\/github.com\/ChaseKnowlden\">ChaseKnowlden<\/a>: Fix inconsistent link in README (<a href=\"https:\/\/github.com\/Microsoft\/vscode-jupyter\/issues\/10396\">vscode-jupyter#10396<\/a>).<\/li>\n<li><a href=\"https:\/\/github.com\/kilacoda\">kilacoda<\/a>: Remove extra button from Restart Kernel modal (<a href=\"https:\/\/github.com\/Microsoft\/vscode-jupyter\/issues\/10539\">vscode-jupyter#10539<\/a>).<\/li>\n<li><a href=\"https:\/\/github.com\/afeld\">afeld<\/a>: Add more context around the extension in the README (<a href=\"https:\/\/github.com\/microsoft\/vscode-black-formatter\/issues\/82\">vscode-black-formatter#82<\/a>).<\/li>\n<\/ul>\n<p>Try out these new improvements by\u00a0<a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">downloading the Python extension<\/a>\u00a0and the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-toolsai.jupyter\">Jupyter extension<\/a> from the Marketplace, or install them directly from the extensions view in Visual Studio Code (Ctrl\u00a0+\u00a0Shift\u00a0+\u00a0X\u00a0or\u00a0\u2318\u00a0+\u00a0\u21e7\u00a0+\u00a0X). You can learn more about\u00a0<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,\u00a0<a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/new\/choose\">please file an issue<\/a>\u00a0on the\u00a0<a href=\"https:\/\/github.com\/Microsoft\/vscode-python\">Python VS Code GitHub<\/a>\u00a0page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019re excited to announce that the July 2022 release of the Python and Jupyter extensions for Visual Studio Code are now available. This release includes inlay type hints with Pylance and improvements to the setup experience with Jupyter notebooks. If you\u2019re interested, you can check the full list of improvements in our changelogs for the [&hellip;]<\/p>\n","protected":false},"author":1064,"featured_media":8985,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,6],"tags":[],"class_list":["post-8981","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-visual-studio-code"],"acf":[],"blog_post_summary":"<p>We\u2019re excited to announce that the July 2022 release of the Python and Jupyter extensions for Visual Studio Code are now available. This release includes inlay type hints with Pylance and improvements to the setup experience with Jupyter notebooks. If you\u2019re interested, you can check the full list of improvements in our changelogs for the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/8981","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=8981"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/8981\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media\/8985"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media?parent=8981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/categories?post=8981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/tags?post=8981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}