How-To's

New Features in the Latest ReSharper 8 EAP

Good news everyone — we’ve got another EAP build ready and it should come as no surprise that we’ve got a few new features to talk about. So without further ado, here’s what we’ve got in store for you today.

Extension Manager or how to provide xUnit.net support

We sometimes get requests to provide certain features out of the box, functionality that is currently provided via plugins. xUnit.net support is one of these.

While doing this certainly has its benefits, it also has disadvantages. As such, we decided instead to take the opportunity to address the core problem, which is to simplify the discovery, installation and updating of ReSharper plugins.

We’re very pleased to introduce our NuGet based Extension Manager. It’s now very easy to add extensions and plugins to ReSharper, all from a user interface you’re very familiar with from NuGet. Simply open the Extension Manager from the ReSharper menu, and you’ll be able to browse and search for extensions from the “Online” category – make sure you select “Include Prerelease” in the drop down first – these are still EAP packages!

So to get xUnit.net test support, simply find the xunitcontrib package and hit Install.

That’s all there is to it! ReSharper now has support for running xUnit.net tests, and includes Live Templates and External Annotations to make your test code writing experience better.

We’ll be taking a more in-depth look at this feature very soon, but one important point to make right now is that because NuGet is a .NET4 library, the Extension Manager is only available in Visual Studio 2012 and 2010.

ToString() Format Completion

ReSharper already has a few features related to String.Format() usage, such as for example inspections and fixes related to format arguments being used in the format string. However, in this EAP we’re taking it a bit further by adding code completion for types which have well-known format specifiers (such as DateTime, TimeSpan, Guid, enumerations and many others):

Multi-File Templates

By popular demand, ReSharper’s support for file templates has been expanded to incorporate the possibility of creating several files from a single template. You start, as always, by creating a single file template. But then, ReSharper gives you controls to add additional files: you can either add a new file or a file from an existing template:

Choosing one of these options adds another editor into the template editor window. In this editor, you can specify the placement of the file (either a relative location or an ASP.NET code-behind file), the name of the folder to place the file into, and of course the name of the file. Then, just edit this template as you would any other — you can reuse the parameters you declared for the first template.

You can add as many files as you want and once you come to fire the template, all the necessary files (and folders, if they do not exist) will be automatically created in the right places.

Go To Generic Subsitutions

When you have the usage of a generic type such as List<Foo>, it’s easy enough to find all usages of List<T>, but what if you want to know the exact types that List<T> is being specialized with. To help with this, one of the new navigation options is to look for Generic Substitutions:

Once you fire up this navigation item, ReSharper will search for all the types that are used to substitute the generic parameter T and will show you a summary tree grouped by the type used to substitute the generic parameter. You can drill down into the tree to find out the exact locations where a particular type is used:

Blue Theme Support

Visual Studio 2012 Update 2 has been released with support for a Blue Theme, and we’ve made adjustments to ensure that ReSharper plays nice with it too:

We’ve got a lot more in store, and we’ll be blogging in the coming weeks about new features as well as giving in-depth overviews of the ones we’ve already mentioned. Meanwhile, please feel free to check out the EAP and let us know what you think!

image description