ReSharper 2023.2 EAP 5: Improved Control Over Object Disposal, Support for Default Lambda Parameters, and C++23 Standard Library Modules.
The latest build for the ReSharper 2023.2 Early Access Program is available for download from our website.
Let’s take a look at what’s inside!
Support for default parameter values in lambdas
As part of our work on supporting C# 12 language updates, we’re introducing support for default parameter values in lambda expressions in ReSharper 2023.2. In addition to the standard set of warning messages associated with recognizing this syntax, we’ve also tweaked an existing inspection, The parameter has the same default value, 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.
New inspections for improved control over object disposal
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.
When a variable is captured by a
using statement, it ensures that the object is properly disposed of when it goes out of scope. Returning an object captured by a
using 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.
The Return of a variable captured by ‘using’ statement inspection alerts you in cases where the returned object is immediately disposed of.
Similarly, the Return of a task produced by ‘using’-captured object inspection identifies scenarios where a
Task is produced by an object captured by a
using statement and then immediately returned. To extend the lifetime of the disposable object enough for
Task completion, a corresponding quick-fix will introduce asynchronous awaiting for that
Task before its return.
This EAP build brings support for the C++23 standard library modules and C++20’s
[[no_unique_address]] attribute, new code formatter settings, and other updates.
For more details, please refer to this blog post.
Group by Thread for sampling, tracing, and line-by-line snapshots
dotTrace 2023.2 introduces the Group by Thread option and corresponding button in the Call Tree 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.
Using this grouping method can also give you a birds-eye view of the project’s performance, as the call trees with the most ancestors will end up at the top of the list, making any hotspots glaringly obvious.
Once you’ve clicked on the Group by Thread 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.
That’s 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. As always, we’d love to hear your opinions and suggestions in the comments below.
Subscribe to Blog updates
Thanks, we've got you!
Eager, Lazy and Explicit Loading with Entity Framework Core
Entity Framework Core (EF Core) supports a number of ways to load related data. There’s eager loading, lazy loading, and explicit loading. Each of these approaches have their own advantages and drawbacks. In this post, let’s have a quick look at each of these ways to load data for navigational prope…
First-class Upgrades for ASP.NET Core with JetBrains Annotations
How to use JetBrains Annotations to enable first-class support in your ASP.NET Core libraries. These techniques will transform your user experience into an enjoyable and productive experience for ReSharper and Rider users.
.NET Annotated Monthly | September 2023
Did you know? The original usage of the term “computer” referred to people (mostly women), not machines. It’s possible that one day the word “programmer” could morph into meaning “AI”, and no longer refers to a person. .NET news Visual Studio for Mac Retirement Announcement 🚮…
ReSharper 2023.3 Roadmap
The next Early Access Program (EAP) for ReSharper version 2023.3 is right around the corner, so it’s high time to let you know what we’ll be working on in the coming months. This roadmap is just a preliminary plan and may be adjusted depending on our priorities and resources as well as changes in…