{"id":210182,"date":"2021-12-08T12:58:03","date_gmt":"2021-12-08T11:58:03","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=dotnet&#038;p=210182"},"modified":"2021-12-08T13:42:30","modified_gmt":"2021-12-08T12:42:30","slug":"resharper-2021-3","status":"publish","type":"dotnet","link":"https:\/\/blog.jetbrains.com\/zh-hans\/dotnet\/2021\/12\/08\/resharper-2021-3","title":{"rendered":"ReSharper 2021.3 Brings Visual Studio 2022 Support, More C# 10 Features, and Improved Support for Nullable Reference Types and C#!"},"content":{"rendered":"\n<p>Hello everyone!&nbsp;<\/p>\n\n\n\n<p>Today we published the 2021.3 release for <a href=\"https:\/\/www.jetbrains.com\/resharper\/download\" class=\"ek-link\" target=\"_blank\" rel=\"noopener\">ReSharper and the JetBrains .NET tools<\/a>.&nbsp;<\/p>\n\n\n\n<p>In this post I will briefly cover some of the most exciting updates included in the newest version of ReSharper and ReSharper C++. To learn more about our other .NET tools, including dotCover, dotMemory, dotPeek, and dotTrace, please check out this <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2021\/12\/08\/dottools-2021-3\/\" class=\"ek-link\">separate blog post<\/a>.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.jetbrains.com\/resharper\/download\/\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" loading=\"lazy\" width=\"1600\" height=\"800\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/12\/Blogpost_image_800x400_ReSharper-2x.png\" alt=\"\" class=\"wp-image-210590\"\/><\/a><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>Before we dive into the feature set, we need to make an important announcement. Starting with the 2021.3 release, dupFinder will no longer be included in the ReSharper Command-Line Tools package. You can still use the dupFinder tool from previous releases. Learn more in the&nbsp;<a target=\"_blank\" href=\"https:\/\/blog.jetbrains.com\/dotnet\/2021\/08\/12\/sunsetting-dupfinder-command-line-tool\/\" rel=\"noreferrer noopener\">blog post<\/a>.<\/p><\/blockquote>\n\n\n\n<p>Let\u2019s take a closer look!<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">ReSharper<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Support for Visual Studio 2022<\/h2>\n\n\n\n<p>ReSharper now supports the release build of the new Visual Studio 2022. You will have access to the same rich feature set you are already used to having in other Visual Studio versions. But since Visual Studio 2022 is an x64 process, there is no longer a limit to the maximum amount of memory that can be allocated to it. As a result, all ReSharper features work faster.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1200\" height=\"1134\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/12\/vs2022-1.png\" alt=\"\" class=\"wp-image-210756\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">More C# 10 features<\/h2>\n\n\n\n<p>ReSharper continues to add more C# 10 features. Today, we are happy to add support for file-scoped namespaces,<em> <\/em><code>global using<\/code> directives, the <code>CallerArgumentExpression<\/code> attribute, the \u201cinterpolated string handlers\u201d concept, <code>readonly record<\/code> structs, and C# 10 lambdas. You can learn more about them in our <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2021\/10\/28\/file-scoped-namespaces-in-csharp-10\/\" class=\"ek-link\">series about the new C# 10 features<\/a> or directly on <a href=\"http:\/\/www.jetbrains.com\/resharper\/whatsnew\/#c-10\" class=\"ek-link\" target=\"_blank\" rel=\"noopener\">the What\u2019s New page<\/a>.&nbsp;<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/12\/cs10-file-scoped-namespace.png\" width=\"800px\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/12\/cs10-file-scoped-namespace.gif\">\n\n\n\n<h2 class=\"wp-block-heading\">Support for nullable reference types<\/h2>\n\n\n\n<p>Let\u2019s say you paste in some code with NRT syntax but you don\u2019t have NRTs enabled in your solution. There is now a quick-fix that gets rid of the NRT syntax for you. There are also several helpful new quick-fixes:<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/12\/nrt-null-check-parameter.png\" width=\"800px\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/12\/nrt-null-check-parameter.gif\">\n\n\n\n<ul><li>A quick-fix for eliminating nullability mismatches between type arguments and their nullability constraints<\/li><li>A bulk quick-fix for correcting annotations on parameters with nullable default values in a file, project, or whole solution.<\/li><li>A new bulk quick-fix that makes a parameter nullable if it&#8217;s checked for <code>null<\/code> within a method.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">General C# code analysis improvements<\/h2>\n\n\n\n<p>The latest version of C# isn\u2019t the only one getting support improvements. This release brings additional inspections and quick-fixes for general C# support, as well:<\/p>\n\n\n\n<ul><li>New quick-fixes for <code>static<\/code> local and anonymous functions with closures.&nbsp;<\/li><li>Improved support for regular <code>structs<\/code>.&nbsp;<\/li><li>Quick-fixes that convert classes to <code>records<\/code> and then transform them into primary constructors.&nbsp;<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1200\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/12\/cs-struct.png\" alt=\"\" class=\"wp-image-210701\"\/><\/figure>\n\n\n\n<p>Additionally, scope quick-fixes and context actions are now executed in parallel and use the results of solution-wide analysis.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Navigation and<em> Find Usages<\/em><\/h2>\n\n\n\n<p>We\u2019ve added a few more gutter marks to help you quickly navigate through the inheritance structure of a class, interface, or struct. The new <code>\u2191O<\/code> icon indicates that a code entity inherits a class, while the <code>\u2191I<\/code> icon indicates that the code entity implements an interface. Additionally, ReSharper will add the <code>\u2193O<\/code> icon in the left gutter next to a class member if the class member is overridden in derived classes.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1200\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/12\/find-usages-newgutter-class-interface.png\" alt=\"\" class=\"wp-image-210679\"\/><\/figure>\n\n\n\n<p>You can now call<em> Find Usages <\/em>for user-defined implicit conversion operators. This allows you to find out whether user-defined implicit conversion operators are used at all and then navigate to blocks of code with conversions.<\/p>\n\n\n\n<p>Finally, when you invoke <em>Go to Type of Symbol<\/em> on a variable or parameter of an interface type in debug mode, ReSharper will take you to the exact implementation of it that is used in the current frame, rather than the interface declaration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Other updates<\/h2>\n\n\n\n<ul><li>You can now mark any of a function\u2019s parameters, fields, or properties with the <code>LanguageInjection<\/code> annotation attribute. ReSharper will consider a string of a marked code entity as a code fragment in a specified language. The following languages can be injected: CSS, HTML, JavaScript, JSON, or XML.<\/li><li>We\u2019ve redesigned the <em>Copy Code Reference<\/em> feature<strong>. <\/strong>It has a new name, a new UI, and new GitHub options for generating proper links to GitHub repositories and sharing them with anyone right away.<strong> <\/strong>Learn more in <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2021\/10\/11\/copy-code-reference-in-resharper-and-rider-2021-3-eap\/\">this blog post<\/a>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1200\" height=\"540\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/12\/copy-code-reference.png\" alt=\"\" class=\"wp-image-210690\"\/><\/figure>\n\n\n\n<ul><li>There are several new formatting options that allow you to format your code more precisely.<\/li><li>We\u2019ve added support for <em>AnalyzerConfig<\/em> files to adjust ReSharper\u2019s rules accordingly.<\/li><\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">ReSharper C++&nbsp;<\/h1>\n\n\n\n<p>Here\u2019s just a sample of the highlights in the ReSharper C++ updates:<\/p>\n\n\n\n<ul><li>All predefined templates for <strong>Unreal Engine classes<\/strong> are now available in the list of ReSharper C++ file templates, so you no longer need to switch to Unreal Editor to create new classes.<\/li><\/ul>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/10\/create_ue_class.png\" width=\"800px\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/10\/create_ue_class.gif\">\n\n\n\n<ul><li>We\u2019ve added support for more <strong>C++20<\/strong> features: auto-completion of designated initializers for aggregate initialization and modernizing inspections to help you adopt new library functions.<\/li><li>Updates for <strong>C support<\/strong> include <code>C11 _Generic<\/code> expressions and the <code>typeof<\/code> GNU extension.<\/li><li>The <em>Quick Info<\/em> tooltip now displays the evaluation results for constant expressions.<\/li><li>There are new inspections with quick-fixes and an update for Clang-Tidy with new checks from Clang 13.<\/li><\/ul>\n\n\n\n<p>Check out <a href=\"https:\/\/blog.jetbrains.com\/rscpp\/2021\/12\/08\/resharper-cpp-2021-3\/\" class=\"ek-link\">this blog post<\/a> for details about all new features and improvements in ReSharper C++.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>If you are eager to learn more about all these ReSharper features, please visit <a href=\"http:\/\/www.jetbrains.com\/resharper\/whatsnew\/\" class=\"ek-link\" target=\"_blank\" rel=\"noopener\">the What\u2019s New page<\/a>.&nbsp;<\/p>\n\n\n\n<p>To learn more about our other .NET tools, including dotCover, dotMemory, dotPeek, and dotTrace, please check out this <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2021\/12\/08\/dottools-2021-3\/\" class=\"ek-link\">separate blog post<\/a>.<\/p>\n\n\n\n<p>You can download the release build right now from <a href=\"https:\/\/www.jetbrains.com\/resharper\/download\" class=\"ek-link\" target=\"_blank\" rel=\"noopener\">the ReSharper 2021.3 page<\/a> or install it using the <a href=\"https:\/\/www.jetbrains.com\/toolbox-app\/\" target=\"_blank\" rel=\"noopener\">JetBrains Toolbox App<\/a>. As always, we would appreciate any feedback you have about the new features.<\/p>\n","protected":false},"author":307,"featured_media":211468,"comment_status":"closed","ping_status":"closed","template":"","categories":[4992,89,907],"tags":[6766,3606,1914,6699,46,486,6710],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/210182"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/types\/dotnet"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/users\/307"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=210182"}],"version-history":[{"count":9,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/210182\/revisions"}],"predecessor-version":[{"id":241483,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/210182\/revisions\/241483"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/211468"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=210182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=210182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=210182"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=210182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}