.NET Tools News Releases Rider

Rider 2023.2 EAP 5: Improved Support for C#, Better Performance Profiling, and More.

The latest installment in our Early Access Program for Rider 2023.2 is here. But before you download this build, let’s go over the most important updates it contains.

C# support

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 Rider 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

Rider 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. 

Terminal migration to ConPTY on Windows

JetBrains Rider includes an embedded terminal emulator to work with a command-line shell from inside the IDE. Previous versions of Rider relied on a third-party WinPTY library as a terminal emulation layer on Windows. For Rider 2023.2, we’re switching to the OS-provided ConPTY for versions of Windows that support it. While no visible changes are expected, the switch opens the door for further improvements to the terminal and the run console.

Performance profiling

Group by Thread for sampling, tracing, and line-by-line snapshots

The dotTrace Profiler inside Rider 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. 

Notable fixes

  • We added support for the UE_INLINE_GENERATED_CPP_BY_NAME include, which improves compile time when added to your project’s .cpp file (RSCPP-34358).
  • We fixed a bug that caused the reformatting of project files after a user executed any project modification actions (RIDER-40468).

Known vulnerabilities

A vulnerability exists in .NET 6.0, .NET7.0, and NuGet where a potential race condition that can lead to a symlink attack on Linux. Non-Linux platforms are not affected.

Our team is aware of the issue, and we’re working on eliminating it.

For the full list of resolved issues, please refer to our issue tracker.

That’s it for now! Please share your feedback on the latest EAP builds of Rider in the comments below or on social media.

image description

Discover more