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.
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.
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:
1 |
if (cond) x = value; else throw new Exception(); |
you can quickly convert it to this:
1 |
x = cond ? value : throw new Exception(); |
The
.throw postfix template generates a throw statement in the expression if it’s applicable:
Angular 2 and TypeScript
ReSharper’s code completion now works for component tags and attributes, as well as for
[attr.,
[style., and
[class..
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.
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.
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!
Pingback: ReSharper Ultimate 2017.1 – Alles zur neuen Version
Pingback: Dew Drop - March 21, 2017 (#2444) - Morning Dew
Will there be a code fix to reference ValueTuple from NuGet semi-automatically?
It’s unlikely that we implement it in 2017.1. We have this issue filed in our tracker https://youtrack.jetbrains.com/issue/RSRP-463543, so you can vote for it and track the progress.
Currently, you can use “Find this type on nuget.org” feature (see here http://imgh.us/nuget.gif)
Do you have a release date in mind please?
The release is planned for the next week. And in the meantime, you can download our pre-release EAP https://www.jetbrains.com/resharper/eap/
Somewhat off of Dude, will there be a fix for ValueTuples? Currently if I define “(string Text, TimeSpan Duration) params”, I see autocomplete shows “Text” and “Duration” but when I autocomplete it converts it to “Item1” and “Item2”
Are you using the latest EAP6? Have just checked and it works correctly.
On the EAP 7 I’m still having problem discovering xUnit tests, with the following exception thrown during exploration:
Message = “
dotnet exited unexpectedly with the code (-1)
Output stream:
Error stream: dotnet-test Error: 0 : System.InvalidOperationException: E:\\project.json does not exist.
at Microsoft.DotNet.Tools.Test.TestCommand.GetProjectPath(String projectPath)
at Microsoft.DotNet.Tools.Test.TestCommand.DoRun(String[] args)
”
ExceptionPath = Root.InnerException
ClassName = JetBrains.ReSharper.UnitTestFramework.DotNetCore.Exceptions.ProcessExitedUnexpectedlyException
HResult = COR_E_EXCEPTION=80131500
Looks like it’s still looking for a project.json file?
I can discover and run the same tests fine in the VS Test explorer
There was an issue with unit tests discovery in this EAP. It is fixed in the next EAP that will be published today.
Hi! I just installed this morning the EAP 8 but the exploration is still failing with the same error message…
Have you also installed the latest Visual Studio 2017 update?
Yes, running build 26228.10
The xUnit tests are discovered correctly by VS, and I can run them fine with the Test Explorer, but they don’t appear in R# Unit tests explorer
Ok, thanks. We are investigating this issue.
Hi, Julien!
Do you have global.json file in your project folder?
If yes, could you please temporary remove it, restart VS and open your project. Does the problem persist?
Hi
Yes I removed the global.json file and now it works. Thanks!
Hi I’m new to ReSharper, concerning intellisense, is there a way for more advanced filtering, like filtering out deprecated members and inherited base members?
That is a much requested feature for VS and would be an a huge selling point for me.