Hello everyone. This week we have published a new EAP build of ReSharper Ultimate 2016.1 (formerly referred to as ReSharper Ultimate 10.1), bringing new fixes and improvements.
(If you’re wondering why a sudden change of versioning, please see JetBrains Toolbox — Release and Versioning Changes.)
Below is what we have added in this latest build.
Out-of-the-box xUnit.net support
The xUnit.net test framework has seen a large rise in popularity recently, including being the framework of choice for Microsoft’s cross platform, open source .NET Core project, and is the officially supported way of running tests for DNX projects.
While ReSharper has had support for xUnit.net for many years, it has always required installing a separate extension. Starting with EAP 6, ReSharper now provides support for xUnit.net directly in the product. This means ReSharper will discover your tests, and allow you to run and debug them, right from the editor, without requiring any extra extensions.
Furthermore, ReSharper Ultimate users will also be able to profile tests, get code coverage and use xUnit.net in Continuous Testing sessions.
One thing to note is that this build does not yet support running tests for DNX projects, this will hopefully be included in a future build.
New code style features
There are two new features to further extend the level of detail of your code style. As usual with code style, the new features are configurable and can be applied as part of code cleanup.
Using named/positional arguments
Consider the following method call:
AddCheckbox(true, true, "AutoFill", null);
When you read this code, you have to stop and examine the method signature to understand what happens here. With named arguments, the call becomes much clearer:
AddCheckbox(enabled: true, value: true, label: "AutoFill", tooltip: null);
Now, if you prefer to have named arguments for specific types, you can do so with a little help from ReSharper. In the Code Editing | C# | Code Style page of ReSharper options, define for which types of parameters you prefer to use named arguments, and the corresponding suggestions will be added to the list of quick-fixes:
In addition, even if you do not have any style preferences for arguments, you can always press Alt+Enter on any named or positional argument and choose to add or remove the argument name.
Braces for single-line statements
C# specification allows you to safely omit braces around single nested statements in some parent statements, e.g.
foreach, etc. However, code style guidelines may differ in this regard: some consider the braces here as a requirement, some consider them redundant.
Whatever style you prefer, ReSharper now helps you have consistent use of braces throughout your code base. Preferences for each kind of code block can be configured separately in a code style options page, and ReSharper makes sure to respect these preferences:
Here is the full list of fixes for ReSharper in this EAP build.
This build brings some bug fixes and a few UI improvements to the Continuous Testing Session window. Quick search results are now highlighted in the coverage tree, and a button is added to explore the stack trace of the selected test in Stack Trace Explorer:
dotMemory Unit 2.2
There is another small improvement that have to do with dotMemory Unit. While only constant values can be used when initializing attribute properties, there was a problem of defining user-specific directories for
DotMemoryUnitAttribute.Directory property when saving workspaces. Now there are three new constants that evaluate to
%LOCALAPPDATA%. You can either use the constants from the
SpecialDirectory class, e.g:
[DotMemoryUnit(Directory = SpecialDirectory.User + "MySubDirectory")]
or simply write one of these constants in angle bracketes (
[DotMemoryUnit(Directory = @"<User>/MySubDirectory")]
The mandatory call to action
If you haven’t done it already, please download the latest ReSharper Ultimate 2016.1 EAP build.