{"id":9598,"date":"2024-02-01T15:21:38","date_gmt":"2024-02-01T23:21:38","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/python\/?p=9598"},"modified":"2024-02-01T15:21:38","modified_gmt":"2024-02-01T23:21:38","slug":"python-in-visual-studio-code-february-2024-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-february-2024-release\/","title":{"rendered":"Python in Visual Studio Code &#8211; February 2024 Release"},"content":{"rendered":"<p>We\u2019re excited to announce the February 2024 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!<\/p>\n<p>This release includes the following announcements:<\/p>\n<ul>\n<li>Python debugger extension installed by default<\/li>\n<li>Create Environment option in the Python interpreter Quick Pick<\/li>\n<li>Jupyter&#8217;s built-in variable viewer<\/li>\n<li>New diagnostic rules with Pylance<\/li>\n<li>VS Code triggered breakpoints with Python<\/li>\n<\/ul>\n<p>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\/releases\">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>Python Debugger extension installed by default<\/h2>\n<p>The <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.debugpy\">Python Debugger<\/a> extension is now installed by default alongside the Python extension.<\/p>\n<p>The Python Debugger extension aims to separate the debugging functionality from the main Python extension to prevent compatibility issues. This ensures that even as the Python extension drops support for older Python versions (e.g., Python 3.7), you can continue debugging projects with those versions without downgrading the Python extension. It also delivers platform-specific builds, ensuring you only receive the components relevant to your specific operating system, reducing download times and unnecessary overhead.<\/p>\n<p>The Python Debugger extension enables all the functionality you are used to and more!<\/p>\n<p>To ensure you are using the new Python Debugger extension, replace <code>\"type\": \"python\"<\/code> with <code>\"type\": \"debugpy\"<\/code> in your <code>launch.json<\/code> configuration file. In the future, the Python extension will no longer offer debugging support, and we will transition all debugging support to the Python Debugger extension.<\/p>\n<h2>Create Environment option in the Python interpreter Quick Pick<\/h2>\n<p>You can now more conveniently create a Python environment from the Python interpreter Quick Pick. Run the <strong>Python: Select Interpreter<\/strong> command, and then select the <strong>Create Virtual Environment<\/strong> option to create a new virtual environment for your project.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/02\/python-create-env-from-quick-pick.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-9595\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/02\/python-create-env-from-quick-pick.png\" alt=\"Screenshot of the Create Virtual Environment option in the Select Interpreter Quick Pick.\" width=\"1722\" height=\"887\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/02\/python-create-env-from-quick-pick.png 1722w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/02\/python-create-env-from-quick-pick-300x155.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/02\/python-create-env-from-quick-pick-1024x527.png 1024w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/02\/python-create-env-from-quick-pick-768x396.png 768w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/02\/python-create-env-from-quick-pick-1536x791.png 1536w\" sizes=\"(max-width: 1722px) 100vw, 1722px\" \/><\/a><\/p>\n<h2>Jupyter&#8217;s built-in variable viewer<\/h2>\n<p>The Jupyter extension has added an experimental variable viewer to the Run and Debug panel. You can enable this experience by adding <code>\"notebook.experimental.variablesView\": true<\/code> in your User <code>settings.json<\/code> file. This built-in variable view can be used to view variables from your notebook kernel, helping you monitor variables in your program as your code is run. This is especially helpful when debugging your code as you can monitor the value of your variables in real time.<\/p>\n<p>The built-in variable viewer is still under active development. Feedback and suggestions are welcomed in the <a href=\"https:\/\/github.com\/microsoft\/vscode-jupyter\">vscode-jupyter<\/a> repo.<\/p>\n<h2>New diagnostic rules with Pylance<\/h2>\n<p>Pylance, which is powered by <a href=\"https:\/\/microsoft.github.io\/pyright\/\">Pyright<\/a>, used to display <code>reportGeneralTypeIssues<\/code> diagnostics for a variety of typing issues in your code when type checking mode is enabled. This diagnostic rule has been modified in Pyright to allow for a more granular control over the diagnostics and is now available in Pylance Pre-Release. The <code>reportGeneralTypeIssues<\/code> diagnostic has been broken down into the following new rules:<\/p>\n<ul>\n<li><code>reportAbstractUsage<\/code><\/li>\n<li><code>reportArgumentType<\/code><\/li>\n<li><code>reportAssertTypeFailure<\/code><\/li>\n<li><code>reportAssignmentType<\/code><\/li>\n<li><code>reportAttributeAccessIssue<\/code><\/li>\n<li><code>reportCallIssue<\/code><\/li>\n<li><code>reportInconsistentOverload<\/code><\/li>\n<li><code>reportIndexIssue<\/code><\/li>\n<li><code>reportInvalidTypeArguments<\/code><\/li>\n<li><code>reportInvalidTypeForm<\/code><\/li>\n<li><code>reportNoOverloadImplementation<\/code><\/li>\n<li><code>reportOperatorIssue<\/code><\/li>\n<li><code>reportPossiblyUnboundVariable<\/code><\/li>\n<li><code>reportRedeclaration<\/code><\/li>\n<li><code>reportReturnType<\/code><\/li>\n<li><code>reportUnusedExcept<\/code><\/li>\n<\/ul>\n<p>You can refer to the <a href=\"https:\/\/microsoft.github.io\/pyright\/#\/configuration?id=main-configuration-options\">configuration documentation<\/a> for more details about each of them.<\/p>\n<h2>VS Code Triggered Breakpoints with Python<\/h2>\n<p>VS Code has added support for triggered breakpoints! Triggered breakpoints are breakpoints that are automatically enabled once another breakpoint is hit. For example, this can be very useful when diagnosing failure cases in code that happen only after a certain pre-condition.<\/p>\n<p>Triggered breakpoints can be set by right-clicking on line gutter, selecting <strong>Add Triggered Breakpoint&#8230;<\/strong>, and then choosing which breakpoint enables this one.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/02\/triggeredbreakpoint.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-9596\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2024\/02\/triggeredbreakpoint.gif\" alt=\"Gif demonstrating triggered breakpoints in a Python project.\" width=\"3511\" height=\"1746\" \/><\/a><\/p>\n<p>Support for triggered breakpoints is enabled for all languages, not just Python!<\/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>Fix duplicated suggestions for Python and avoid launching another language server in <a href=\"https:\/\/github.com\/microsoft\/vscode-jupyter\/issues\/13596\">@vscode-jupyter#13596<\/a>.<\/li>\n<li>Added support for multi-level pytest classes allowing for top-level classes to be displayed in the Test Explorer in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/22520\">@vscode-python#22520<\/a>.<\/li>\n<li>Interpreter quick pick now displays the name of conda environments to make it easier to identify them in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/21770\">@vscode-python#21770<\/a>.<\/li>\n<li>New <a href=\"https:\/\/code.visualstudio.com\/docs\/python\/python-quick-start\">Python Quick Start<\/a> docs page to get you up and coding quickly!<\/li>\n<\/ul>\n<p>We would also like to extend special thanks to this month\u2019s contributors:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/PopoDev\">@PopoDev<\/a> Show name for conda environments created in the workspace in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/22701\">@vscode-python#22701<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/yilei\">@yilei<\/a> Support range formatting when using Black 23.11.0+ in <a href=\"https:\/\/github.com\/microsoft\/vscode-black-formatter\/pull\/380\">@vscode-black-formatter#380<\/a><\/li>\n<\/ul>\n<h2>Call for Community Feedback<\/h2>\n<p>As we are planning and prioritizing future work, we value your feedback! Below are a few issues we would love feedback on:<\/p>\n<ul>\n<li>Design proposal for test coverage in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/22827\">(@vscode-python#22827)<\/a><\/li>\n<\/ul>\n<p>Try out these new improvements by downloading the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">Python extension<\/a> and 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 + Shift + X or \u2318 + \u21e7 + X). 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. 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 page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The February 2024 release of the Python and Jupyter extensions for Visual Studio Code are now available. This month&#8217;s updates include the Python Debugger extension installed by default, option to create a virtual environment in the interpreter Quick Pick, built-in variable viewer with Jupyter, new diagnostic rules with Pylance, and triggered breakpoints in VS Code. Keep reading to learn more!<\/p>\n","protected":false},"author":99209,"featured_media":10119,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[17],"class_list":["post-9598","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python"],"acf":[],"blog_post_summary":"<p>The February 2024 release of the Python and Jupyter extensions for Visual Studio Code are now available. This month&#8217;s updates include the Python Debugger extension installed by default, option to create a virtual environment in the interpreter Quick Pick, built-in variable viewer with Jupyter, new diagnostic rules with Pylance, and triggered breakpoints in VS Code. Keep reading to learn more!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/9598","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\/99209"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/comments?post=9598"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/9598\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media\/10119"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media?parent=9598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/categories?post=9598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/tags?post=9598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}