{"id":363864,"date":"2023-06-16T16:11:40","date_gmt":"2023-06-16T15:11:40","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=dotnet&p=363864"},"modified":"2023-06-16T16:11:43","modified_gmt":"2023-06-16T15:11:43","slug":"resharper-2023-2-eap-5","status":"publish","type":"dotnet","link":"https:\/\/blog.jetbrains.com\/dotnet\/2023\/06\/16\/resharper-2023-2-eap-5\/","title":{"rendered":"ReSharper 2023.2 EAP 5: Improved Control Over Object Disposal, Support for Default Lambda Parameters, and C++23 Standard Library Modules."},"content":{"rendered":"\n

The latest build for the ReSharper 2023.2 Early Access Program is available for download<\/a> from our website. <\/p>\n\n\n\n

Let\u2019s take a look at what\u2019s inside!<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

C# support<\/h2>\n\n\n\n

Support for default parameter values in lambdas<\/h3>\n\n\n\n

As part of our work on supporting C# 12 language updates, we\u2019re introducing support for default parameter values in lambda expressions<\/a> in ReSharper 2023.2. In addition to the standard set of warning messages associated with recognizing this syntax, we\u2019ve also tweaked an existing inspection, The parameter has the same default value<\/em>, to account for default parameter values in lambdas. This inspection will also be triggered when an invocation has an argument value that is the same as the default value of the parameter in the invoked delegate, making the expression redundant.<\/p>\n\n\n\n

\"\"\/<\/figure>\n\n\n\n

New inspections for improved control over object disposal<\/h3>\n\n\n\n

ReSharper 2023.2 introduces two new code inspections designed to address scenarios where the state of a returned object may be negatively influenced by its early disposal or the early disposal of the object that spawned it.<\/p>\n\n\n\n

When a variable is captured by a using<\/code> statement, it ensures that the object is properly disposed of when it goes out of scope. Returning an object captured by a using<\/code> statement can be problematic because it extends the lifespan of the returned object beyond the method scope, causing the object to be disposed of immediately after returning. This can lead to unexpected behavior and resource-related issues.<\/p>\n\n\n\n

The Return of a variable captured by ‘using’ statement<\/em> inspection alerts you in cases where the returned object is immediately disposed of.<\/p>\n\n\n\n

Similarly, the Return of a task produced by ‘using’-captured object<\/em> inspection identifies scenarios where a Task<\/code> is produced by an object captured by a using<\/code> statement and then immediately returned. To extend the lifetime of the disposable object enough for Task<\/code> completion, a corresponding quick-fix will introduce asynchronous awaiting for that Task<\/code> before its return. <\/p>\n\n\n\n\n\n\n\n

C++ support<\/h2>\n\n\n\n

This EAP build brings support for the C++23 standard library modules and C++20’s [[no_unique_address]] <\/code>attribute, new code formatter settings, and other updates. <\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

<\/a><\/p>\n\n\n\n

For more details, please refer to this blog post<\/a>.<\/p>\n\n\n\n

dotTrace<\/h2>\n\n\n\n

Group by Thread<\/em> for sampling, tracing, and line-by-line snapshots<\/h3>\n\n\n\n

dotTrace 2023.2 introduces the Group by Thread<\/em> option and corresponding button in the Call Tree <\/em>panel for performance snapshots. This option organizes sampling, tracing, and line-by-line snapshots based on individual threads, allowing for deeper insight into thread-specific performance issues. <\/p>\n\n\n\n

\"\"\/<\/figure>\n\n\n\n

Using this grouping method can also give you a birds-eye view of the project\u2019s performance, as the call trees with the most ancestors will end up at the top of the list, making any hotspots glaringly obvious. <\/p>\n\n\n\n

Once you\u2019ve clicked on the Group by Thread<\/em> toggle button, you will see the call trees organized by thread. You can navigate from one thread to another by using the keyboard, and the trees will expand at once. Red-colored percentage values to the left of the call tree indicate higher subtree power, helping you pinpoint potential performance bottlenecks at a glance. <\/p>\n\n\n\n

That\u2019s it for now! For the full list of improvements and fixes that made it into the latest EAP build, please check out our issue tracker<\/a>. As always, we\u2019d love to hear your opinions and suggestions in the comments below.<\/p>\n","protected":false},"author":1337,"featured_media":364176,"comment_status":"closed","ping_status":"closed","template":"","categories":[4992,89,907,3990],"tags":[3606,6773,600,46],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/dotnet\/363864"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/dotnet"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/types\/dotnet"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/users\/1337"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/comments?post=363864"}],"version-history":[{"count":10,"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/dotnet\/363864\/revisions"}],"predecessor-version":[{"id":364206,"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/dotnet\/363864\/revisions\/364206"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/media\/364176"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/media?parent=363864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/categories?post=363864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/tags?post=363864"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/wp-json\/wp\/v2\/cross-post-tag?post=363864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}