A Visual Tour of ReSharper 3.0

ReSharper 3.0 is out now in final form and looks great. Here's a visual walkthrough of some of the 3.0 features, along with some old and otherwise existing ones ReSharper has to offer.

Code Analysis

ReSharper 3.0 has more code analysis features than previous versions. For example here it tells me that I can make this field read-only. Why? Because it's only ever initialized in the declaration and never gets assigned again. You'll also get this suggestion with fields that are initialized in constructors only (but this is a test fixture so there's no constructors). A quick hit of Alt + Enter and I can change this field to the suggestion ReSharper is offering.

ScreenShot010

Putting your cursor on the field and hitting Ctrl + Shift + R let's you select from a list of applicable refactorings. By applicable I mean they're context sensitive to the type, scope, and value you're looking at. For example here I get a set of refactorings I can do to a field.

ScreenShot011

Now if I hit the same shortcut on a method I get these offerings. Note that I can now invoke the Change Signature refactoring (and others) but Encapsulate Field is no longer available. ReSharper recognizes I'm in a method and not a field and does things in a smart fashion by filtering the refactoring menu down to only what's valid.

ScreenShot012

Another suggestion is when methods are only ever referenced by a local class and don't access external values or objects. In that case, ReSharper will suggest that you make the method static. This will reduce on execution time (but we're only talking about saving a few mips here, so don't get too excited).

ScreenShot013

With this (and other refactorings) you can press Alt + Enter to see a list of options. This also appears as a small light bulb in the left hand gutter and shows you a list of refactorings and optimizations you can perform on a method or variable.

ScreenShot014

Navigation

ReSharper not only offers great productivity with it's refactorings, but it really helps out when you're trying to navigate around your codebase. With a few simple keystrokes, you'll be flying through your code in no time.

You can search for a type name by pressing Ctrl + N. This brings up a window for you to type in and narrow down the search. For example here I entered "MI" which shows me all the classes that start with "MI". You'll also notice that "ModuleInfoElement" is also included. This is because the search filters on CamelCase names, which you can also filter down even further.

ScreenShot015

Here we've filtered the "MI" list down a little more by entering "MIC".

ScreenShot016

Even further we enter "MICV" which shows me the view, presenter, and fixture.

ScreenShot017

Documentation and Guidance

ReSharper also knows about your code and can tell you about it. This helps as sometimes you just don't know what a method is expecting or why a parameter is passed to a method.

Here I have my mouse cursor in the parameter to the Add method and pressed Ctrl + P to show parameters and documentation. This is culled from the XML comments in your codebase so it's important to document these!

ScreenShot019

ReSharper also has the ability to generate some simple documentation (via the Ctrl + Q key) in the form of a popup. This provides information about a type, it's visibility, and where it's located (along wtih hyperlinks to types in the popup). Very handy for jumping around (although you do have to engage the mouse).

ScreenShot022

Other Productivity Features

A few other small features that I always find useful.

Ctrl + Shift + V

This pops up a dialog which contains all of the things you've recently copied to the clipboard. You can just highlight the one you want and insert it. Very handy when you have a small snippet that you want to re-use.

ScreenShot023

Ctrl + Alt + V

One of my favorites as I hate typing out values for objects. I'd rather just create the object and not worry about it (ala Ruby) however in C# you do sometimes want a variable around. ReSharper helps you by creating a dialog for taking a method and introducing a variable. It understands the return type and even suggests a name for you. Very quick when you want to reduce the keystrokes:

ScreenShot027

There are a ton of more features that are out there. If you're interested, you should check out Joe White's 31 days of ReSharper he posted back in March/April that has a small tip every day from installation and setup to almost all of the refactorings and tools ReSharper has to offer. Awesome.

6 Comments

  • Thanks for the detail description It was very helpful

  • Its nice, but its taken some tweaking to get it to play nice with Coderush/Refactor Pro (imo a slicker and more than equal competitor).

  • Thanks man, much needed, Great stuff.

  • Definately Agree with this product, its very beneficial. Unfortunately I had to uninstall it today because I COMPLETELY lost Intellisense. But then again I'm still running the beta. I have to buy the real version later this week!

    The only problem I've seen with this is that CTRL + N is TOO SLOW, I want immediate results. It seems like I'm waiting for a second or two before its populated.

  • @Donn: Are you sure you actually *lost* intellisense? ReSharper takes it over but sometimes by default isn't invoked when you press space/dot. Check the settings to see if it's turned on.

    As for the Ctrl+N problem, see Jeff's fix here:
    http://codebetter.com/blogs/jeffrey.palermo/archive/2007/06/19/resharper-2-5-3-0-hack-to-speed-up-ctrl-n-type-discovery.aspx

  • With the great pleasure I read yours блог. Your color scheme in Visual Studio has liked. Do not share adjustments?

Comments have been disabled for this content.