# Sunday, 01 July 2007

... Actually it's been out a couple of days but I wanted to take it out for a spin before posting about it.


Users of the previous version need to be aware that this release is not a free upgrade from 2.x like we've been used to. Existing customers can upgrade their license for $199 while a brand spanking new version will set you back $349. It worth nothing that when you upgrade your existing license you actually get a completely new license for 3.0 something Microsoft should sit up and take notice of considering their annoying scheme of installing Windows Vista and then installing the "upgraded version" on top of that. It reminds me takes me back to upgrading Windows 2000 to Windows XP but that's a different story for another time :)

Additionally JetBrains has created a richer licensing model with separate versions for C#, VB, and a full version with support for both of them. Yes, you read that right, JetBrains now has VB support in ReSharper. More on that later.

JetBrains has really gotten their act together this time around and have released ReSharper 3.0 with Orcas support ahead of the final version of Orcas. I still member when Visual Studio 2005 was released and we had to wait for months and months until they got a ReSharper version out the door with support for that version.

Keyboard Scheme

ReSharper-Keyboard-Scheme-Selector When you first fire up Visual Studio with ReSharper 3.0 installed you will be greeted by my favorite new feature: The ReSharper Keyboard Scheme selector. Basically it allows you to select the keyboard scheme with which you are most comfortable like we've been doing in Visual Studio forever. It addresses one of the pain points I've had with ReSharper since version 1.0: The default shortcuts overrides the ones I'm used to in Visual Studio forcing me to remap keys or keep and exported file with my settings handy. When dealing with shortcuts I usually conform to the default layout of the keyboard just to avoid having to remap keys on every installation of Visual Studio I use. As of today I have 4 - 5 separate installations: One for the laptop, one for the desktop, one for a number of virtual machines... basically a lot of environments to keep in sync which is a pain when you're so dependant on the keyboard as I am.


The product has gotten a lot polish compared to the previous version. Just take look at the settings dialog which will also give you an idea of the scope of the product. Another testament to this fact is that when you install ReSharper you have the option to hide UI elements in Visual Studio which are redundant because ReSharper offers better functionality. Case in point the Refactor menu item on the Visual Studio toolbar which is removed in favor of the ReSharper menu item because that item encompasses so much more than Refactor. Of course this is configurable as you can see on the settings screenshot.


VB Support

JetBrains has spent a lot of time adding support for VB which is great for people doing work in VB. For myself it's a nice to have feature because we do have a couple of projects created in VB still and more importantly projects which mixes and matches VB and C#. I would have liked to I would have been more grateful for the feature two years ago but still it's nice to have the feature I'm used to available to me in both C# and VB. Additionally support for XML and XAML has been added to this version.

TODO Explorer

The TODO explorer (CTRL + ALT + D) is another new addition which actually makes our //TODO comments useful again. I've tried to use TODO comments in my code but I always forget to look them up. I'm sure that Visual Studio provides some sort of UI for viewing a list of TODOs but I can't for the life of me remember how to access it. The TODO Explorer in ReSharper makes it easy to get an overview of the TODOs in your code and ReSharper itself reformats TODO comments in a fashion that makes them stand out more, a nice visual cue that something needs to be done.


File Structure Window

I found the File Structure explorer (CTRL + ALT + F) by accident when I was trying out version 3.0 so I'm not sure whether it's a new feature to ReSharper 3.0 or if it's been there all along. It's new to me at least :) Basically it gives you an overview of the structure of the file you currently have open in Visual Studio. Very handy to make jumping to specific stuff in a file easier. Both the File Structure and TODO Explorer are naturally dockable like you would expect.


Background Compiling for C#

VB offers a feature called background compiling which is very useful because it provides feedback without compiling. When Vertica initially started out we were using VB because everybody came from an ASP 3.0/VBScript/VB6 background which made the choice to go with VB a nobrainer. When we switched to C# a couple of years later the feature I missed the most from VB was background compiling. In fact I was so used to the feature that C# and Visual Studio felt "wrong" somehow; I weren't able to put my finger on it until later when I dug a little and found the background compiling feature of VB. ReSharper offers much the same feature and improves upon the capabilities offered by Visual Studio itself by adding a nice overview of errors in the current file. Notice the right side of the screenshot where a yellow square and a couple of red and orange bars are shown. The square indicates the overall status of the file, the red color means that the file doesn't currently compile. The bars indicate where the errors and warnings are located in the file.

As a nice addition you can scroll through errors (SHIFT + ALT + PgDn / PgUp) and highlights (ALT + PgDn / PgUp) via keyboard shortcuts making it easy and efficient to fix errors.


Context Actions

ReSharper offers another interesting feature which is the context based action (CTRL + Enter). Basically it tells you what the allowed operations at any given point are. Very handy when you're learned the product and don't know all the shortcuts. ReSharper is very keyboard driven which makes it the perfect fit for most C# developers but this is one area where they bring some of the stuff I think VB developers are going to like.



In previous versions of ReSharper you would have to learn shortcuts for every refactoring which meant, for me anyway, that I took the time to learn the most useful ones and left all the other ones alone. Not anymore. As an extension to context based actions we have Refactor This (CTRL + SHIFT + R) which brings up a list of available refactorings based on the place your cursor is at in your code. What this allows for is a single entry point into refactorings allowing you to get familiar with the various possible refactorings and ultimately to use them more than you would otherwise.


Type Completion

Type Completion adds a new level of intellisense to Visual Studio. Basically I can type a partial type name bring up Smart Code Completion (SHIFT+ ALT + Space) which will search through all reference assemblies and suggest type names even without a using statement of the namespace the type is in. Pressing enter will add the using clause to the top of file as well as complete the type. I can't say too many good things about this feature; it simply boots my productivity because I don't have to hunt around for the right namespace.


Unit Testing

If you're into unit testing (and you should be :)) ReSharper has something to offer as well. You'll be able to execute your tests from within Visual Studio ala what TestDriven.NET provides and additionally you get an Unit Test Explorer which makes it easy to overview your test suite. Basically ReSharper allows for much of the same convenience as Team System does by integration xUnit frameworks into Visual Studio.

Bracket Completion

Everything provided by ReSharper is about better productivity. In this section I'll cover all the little things you'll love and get addicted to before you know it :)

Bracket completion basically puts in the closing bracket of a block. Type { and ReSharper adds the matching }. Same thing goes for parentheses. You only save a keystroke but think about all the times a day you actually need this feature. I can't live without this one for sure.

Smart Complete Code

Smart Complete Code (CTRL + ALT + Space) basically an evolved version of Intellisense which gives you more relevant completion than what Visual Studio provides. You can think of the feature as scoped intellisense, whatever is relevant for the scope you're currently in ReSharper suggest. Very handy.

Reformat Code

Reformat Code (CTRL + E + F) is an extension to what was introduced in Visual Studio 2005 where you can specify how your coding style is, i.e. how spacing works, line breaks, all that good stuff. ReSharper actually had this in versions before Visual Studio 2005 came out and 3.0 has even richer support for configuring your coding style. Additionally you can reformat the code of the currently open file and as two new options globally for the entire solution or silently so you don't have to choose which settings to reformat by every time.


Surround With

Imagine that you've written a block of code and you are reminded that you need to do a try-catch around that block of code. You laboriously move the cursor to the start of the block and type try followed by the brace. After you you move the cursor to the end of the block and do the catch maybe followed by a finally block. With ReSharper that operation would go something like highlight the code block press CTRL + E + U select surround with try-catch-block. Surround With is a feature that allows you to surround blocks of code with other code like the try-catch block, a region, an if-statement, and so forth. I use this feature extensively to surround block with regions for example.


Goto Usage

How many times have you wanted to know which pieces of code call the particular method you're currently looking at? I know that I daily want to see this and luckily ReSharper does provide exactly this feature (SHIFT + ALT + F12). If only a single usage is found the you're taken there otherwise a list of the usages is displayed.


With the job market being what it is today my opinion is that it's downright irresponsible to not use tools that boost the overall productivity of developers. Almost every single company is clamoring for developers instead of making the most of the developers already employed in the company. Visual Studio brings a lot of productivity to the table, nice designers, code snippets, background compiling, refactoring. Even innovations in the core framework are about productivity like LINQ, automatic properties, etc..

ReSharper takes many of these familiar tools to new levels and adds new functionality to the best development environment out there. I've been using ReSharper for years and have liked almost every version of the product with exception of 2.0 which was dog slow. I'm happy to report that all the code analysis going on behind the scenes don't slow down Visual Studio noticeably. ReSharper truly delivers on JetBrains' promise of "develop with pleasure".

Monday, 02 July 2007 22:11:55 (Romance Daylight Time, UTC+02:00)
"Additionally you can reformat the code of the currently open file and as two new options globally for the entire solution or silently so you don't have to choose which settings to reformat by every time."

I've looked several times in the options but I can't find the global and silent option for formating code? Where can I find it? Thanks!
Hermann Klinke
Tuesday, 03 July 2007 10:19:23 (Romance Daylight Time, UTC+02:00)
I dunno. I've used every version of resharper, usually for months before uninstalling them due to the horrible horrible effects of project load times and clunkiness. I'll probably try this one too, but I have a feeling it'll be the same way...
Thursday, 05 July 2007 23:46:13 (Romance Daylight Time, UTC+02:00)
Søren: What is your impression of the performance of RS 3.0 compared to the previous versions. Just like jc, I have previously scrapped the tool of performance reasons, and now I am too considering giving this new version a change as well.
Sunday, 08 July 2007 18:04:53 (Romance Daylight Time, UTC+02:00)
j.c. and Jens you both raise a very valid point. I've experienced just how horrible ReSharper 2.0 performed myself. I haven't taken 3.0 for a spin on our largest solutions yet but rest assured that I will do so when I return to work.
Søren Spelling Lund
Sunday, 08 July 2007 18:08:11 (Romance Daylight Time, UTC+02:00)
Hermann, to reformat code globally in an entire solution or project simply select the solution or project in the solution explorer and trigger the reformat function.

The reformat silent option is not available through the ReSharper settings UI rather you need to map a shortcut to it via Visual Studio keyboard settings. The command you're looking for is called ReSharper_SilentReformatCode.
Søren Spelling Lund
Saturday, 25 August 2007 23:37:14 (Romance Daylight Time, UTC+02:00)
Performance is pretty bad, I have a solution where I reference the WSS dll, have about 3000 lines of code in all, terrible performance, can't even see what i'm typing
Todd Wilder
Comments are closed.