{"id":238057,"date":"2022-04-13T18:19:18","date_gmt":"2022-04-13T17:19:18","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=pycharm&#038;p=238057"},"modified":"2022-08-09T16:53:51","modified_gmt":"2022-08-09T15:53:51","slug":"2022-1","status":"publish","type":"pycharm","link":"https:\/\/blog.jetbrains.com\/zh-hans\/pycharm\/2022\/04\/2022-1","title":{"rendered":"Introducing PyCharm 2022.1!"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1280\" height=\"720\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/04\/Release_Blog_Social_share_image_1280x720_PyCharm.png\" alt=\"\" class=\"wp-image-238165\"\/><\/figure>\n\n\n\n<p>In this first release of 2022, we decided to focus on polishing existing features and workflows instead of adding new functionality, especially after our previous release that introduced multiple long-awaited features such as support for Jupyter and Remote Development, respectively. Here is a summary of what\u2019s new in PyCharm 2022.1.<\/p>\n\n\n\n<p align=\"center\">\n    <a class=\"jb-download-button\" href=\"https:\/\/www.jetbrains.com\/pycharm\/download\/\" target=\"_blank\" rel=\"noopener\">      \n        Download PyCharm 2022.1\n    <\/a>\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">IDE<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"custom-packages\">Authentication support for custom package repositories<\/h3>\n\n\n\n<p>Now you can configure basic HTTP authentication to access custom package repositories and manage dependencies via PyCharm without switching to the terminal for manual installation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1620\" height=\"784\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/04\/custom-packages.png\" alt=\"\" class=\"wp-image-240076\"\/><\/figure>\n\n\n\n<p>Go to the <em>Python Packages<\/em> tool window, click on the gear icon, click the plus sign in the dialog window, add the repository URL, and then select the Basic HTTP option to enter the required credentials. The new repository will appear on the list of packages in the left-hand side window.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code insight<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"typeddict-code-completion\">Enhanced code completion for TypedDict<\/h3>\n\n\n\n<p><em>Dict<\/em> literals can be used as arguments for functions or to instantiate objects from classes where TypedDict is expected. Doing so became even easier in PyCharm 2022.1 thanks to its new code completion for keys.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1620\" height=\"784\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/04\/typeddict_code_completion.png\" alt=\"\" class=\"wp-image-238109\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"typeddict-warnings\">Improved TypedDict per-key warnings<\/h3>\n\n\n\n<p>We also improved the warnings for TypedDict. Now, when a dictionary created as a literal or by using the <em>dict<\/em> constructor is used where TypedDict is expected, PyCharm will display per-key error messages pointing to the individual values that are wrong, missing, or not expected.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1620\" height=\"784\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/04\/typeddict_warnings.gif\" alt=\"\" class=\"wp-image-238178\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Improved Markdown support<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"markdown-run-commands\">Run commands from Markdown files<\/h3>\n\n\n\n<p>You often find instructions with commands to execute when working with Markdown files, such as in README files, for example. Now you can just run those commands directly from the file itself, by using the run icon in the gutter.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1620\" height=\"784\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/04\/markdown_run_commands.png\" alt=\"\" class=\"wp-image-238120\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"markdown-code-snippet\">Copy code snippet for Markdown<\/h3>\n\n\n\n<p>Copying and pasting code snippets from Markdown files is also very common, and now you can use the new <em>Copy code snippet<\/em> to do this, available in Markdown blocks.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1620\" height=\"784\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/04\/markdown_code_snippet.png\" alt=\"\" class=\"wp-image-238131\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Jupyter Support [Pro]<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"edit-mode-after-execution\">Code cells remain in Edit mode after execution<\/h3>\n\n\n\n<p>In order to make working with Jupyter notebooks a more fluid experience, new cells inserted after you <em>Run Cell and Insert Below<\/em> now default to Edit mode, so you can start writing code in it right away.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1620\" height=\"784\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/04\/edit_mode_after_execution.gif\" alt=\"\" class=\"wp-image-238189\"\/><\/figure>\n\n\n\n<p>The same behavior applies when you are editing and decide to run your current cell. It will remain in Edit mode even after being executed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"cell-copy-pasting\">Optimized cell copy-pasting<\/h3>\n\n\n\n<p>To make your Jupyter experience more pleasant still, we changed the copy\/cut and paste behavior for when you copy or cut a cell that has an output while in Command mode. Now, whenever you paste it back to your notebook, the output will also be pasted and you won\u2019t need to execute the cell again.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Databases [Pro]<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mongo-db\">MongoDB: Editing fields in results<\/h3>\n\n\n\n<p>In PyCharm 2022.1, editing the results in MongoDB collections or result sets obtained via <em>.find()<\/em> became as easy as it is in relational databases. This improvement also works when cursor methods that modify the result, such as <em>sort()<\/em> or <em>limit()<\/em>, are executed after <em>.find()<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1620\" height=\"784\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/04\/mongo_db.png\" alt=\"\" class=\"wp-image-238142\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Docker [Pro]<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"docker-services-UI\">New Services UI for Docker<\/h3>\n\n\n\n<p>Working with Docker became easier and more organized in PyCharm 2022.1. We\u2019ve significantly reworked the Docker UI in the <em>Services <\/em>tool window to give you much clearer control of your containers, images, networks, and volumes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1620\" height=\"784\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/04\/docker_services_UI.png\" alt=\"\" class=\"wp-image-238153\"\/><\/figure>\n\n\n\n<p>These are all the features we wanted to highlight. Read about other features included in this release on our <a href=\"https:\/\/www.jetbrains.com\/pycharm\/whatsnew\/\" target=\"_blank\" rel=\"noreferrer noopener\">What\u2019s New page<\/a>, or check the [release notes]() for the full list of implemented features and bug fixes.<\/p>\n\n\n\n<p>As always, your feedback is highly appreciated. Share it with us on Twitter (<a href=\"https:\/\/twitter.com\/pycharm\" target=\"_blank\" rel=\"noreferrer noopener\">@pycharm<\/a>), or by reporting any bugs or requests to our <a href=\"https:\/\/youtrack.jetbrains.com\/issues\/PY\" target=\"_blank\" rel=\"noreferrer noopener\">tracker<\/a>.<\/p>\n\n\n\n<p>Happy coding!<\/p>\n\n\n\n<p>The PyCharm team<\/p>\n","protected":false},"author":1101,"featured_media":240113,"comment_status":"closed","ping_status":"closed","template":"","categories":[89,907],"tags":[91],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/pycharm\/238057"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/pycharm"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/types\/pycharm"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/users\/1101"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=238057"}],"version-history":[{"count":10,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/pycharm\/238057\/revisions"}],"predecessor-version":[{"id":240125,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/pycharm\/238057\/revisions\/240125"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/240113"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=238057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=238057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=238057"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=238057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}