Dotnet logo

.NET Tools

Essential productivity kit for .NET and game developers

How-To's

ReSharper Ultimate 2017.1 EAP update: Visual Studio 2017 RTM and more

We are getting closer to the release date and working hard towards providing the finest coding experience to Visual Studio 2017 RTM users. If you are already using the latest release of Visual Studio, make sure to download ReSharper Ultimate 2017.1 EAP 5 to get the best support for its new features.

We have introduced quite a lot of improvements during this EAP, and today we’ll take a look at updates in our two latest EAP builds.

.NET Core and unit testing

A month ago we published a post covering unit testing of a .NET Core apps with ReSharper and gave a detailed explanation of why it worked only in project.json based projects. Now we finally have added support for .csproj based projects. ReSharper discovers and runs MSTest and xUnit tests and supports code coverage and profiling as well as targeting multiple frameworks. There’s also DataRow support for MSTest v2.
Note, that NUnit Engine does not currently support .NET Core projects and the dotnet-test-nunit adapter doesn’t work with the new .csproj format.

Polishing support for C# 7

All in all, ReSharper’s support for C# 7 has noticeably improved in the recent EAP. We’ve added a lot of inspections to comply with the compiler, introduced new quick-fixes, and updated existing ones with new language features.

ReSharper now displays errors in tuples more accurately. For instance, it can detect typos in variable names when overriding a method or implementing an interface.
Detecting errors in tuples

C# 7 removed certain limitations to throwing exceptions, so that developers can now use throw as part of the expression. ReSharper offers a quick-fix to Join null check with assignment, which makes the code more readable by combining the assignment, the null-coalescing operator, and throw. This quick-fix can be applied to a null check in a single statement, as well as to all relevant statements within the class or constructor, whole file, whole project or whole solution.
Join null check with assignment
We’ve also updated the existing context action Convert to ‘?:’ operator and the .throw postfix template to support C# 7 throw expressions. If you apply the context action to this example code:

if (cond) x = value; else throw new Exception();

you can quickly convert it to this:

x = cond ? value : throw new Exception();

The .throw postfix template generates a throw statement in the expression if it’s applicable:
.throw postfix template

Angular 2 and TypeScript

ReSharper’s code completion now works for component tags and attributes, as well as for [attr., [style., and [class..
Code completion for Angular component attributes

Component attributes have received support for one of the most frequently used navigation commands, Go to Declaration, which can be invoked by pressing F12 on an attribute.

The Rename refactoring works for component tags and for ‘foo’ in [class.foo].

We’ve also introduced several bug fixes in order to enable support for the new React and moment-timezone TypeScript typings.

Code formatting

C# formatting styles were enhanced with a few new options. You can now set spaces before and inside the parentheses of ‘nameof’, and choose your preferred wrapping style for chained binary expressions.
Wrapping style for chained binary expressions

ReSharper C++

On the C++ side of things, we’ve implemented initial support for the Open Folder mode and CMake projects. In particular, you can now run unit tests in such projects. Settings for the test run can be configured on a new C++ Tests page in ReSharper options.
Unit testing options page for C++ tests

Download the newest EAP build from our Early Access page, or if you have the previous builds installed get the patch by clicking Check for Updates in the ReSharper menu.

If you encounter any issues, please let us know here in the comments or via Twitter mentioning @ReSharper. And stay tuned the 2017.1 release is coming soon!

image description