Resharper 4.0 is Released

Tuesday, June 10 2008 - - 0 comments

The folks at JetBrains have released Resharper 4.0 and made it available for purchase and download on their web site.

image

The best new feature is the full support for C# 3.0 and LINQ. It has been a long time coming for those working in Visual Studio 2008, but its finally here. If you have not tried using Resharper, you really should. Resharper and DevExpress’s Code Rush / Refactor tools are absolutely awesome. Most developers choose the one they like best and run with it. They make development so much easier, especially when refactoring out issues. Need to find all classes that inherit from a base class?  No problem. Need to find all usages of a variable or control? Easy. Want help in creating code snippets on the fly? These tools both excel in that area.

My favorite feature of Resharper, which by itself is the single most reason I stick with it over  DevExpress’s tools …. is Resharper’s code analysis. At compile time it shows errors and warnings in the open file. You can navigate them using F12 and SHIFT F12, then use ALT-ENTER to see what suggestions Resharper may have for you to fix the issues.

Anyway, I highly recommend looking into these tools.

UPDATE:

Here is a neat image during the installation process that shows several of the features in action.

image

Dark Side with Blue Hues

Saturday, May 31 2008 - , , , - 3 comments

I have many colleagues who have touted the merits of dark backgrounds in Visual Studio and I have tried several variations, yet I always end up back on white. It is not so much that the background needs to be white, rather it is more that I have never found a good mixture of foreground colors that work well on a dark background. Well, I spent some time this evening trying some new settings out. I was determined to find something better for me ... something that would not bother my eyes nearly as much as the bright white backgrounds. Here is what I came up with:

image

It is a mixture of mostly blue, red, green and purple hues that seem to work pretty well for my eyes so far. It is not a true black background either. I found that if I stick to a charcoal background the colors are a bit less striking (to me of course). I like the faded look in general and imagine I will be tinkering with this for a while.

Here is how some XAML looks using my new scheme:

image

The red items are error highlighting from the Resharper styles. I had to tinker quite a bit to get all of the styles to work well, especially since Resharper 4 has its own styles that it injects. Will I keep this theme? Who knows. If you want to try it, I have attached the Dark Side with Blue Hues settings file here. However be warned that you should first backup your settings file before trying any new ones. (This means "try new settings at your own risk")

I'll be turning it back to normal if I take any screen shots for my chapters or articles, though. No need to force my craziness on the editors :)

Resharper 4 Beta Released and Downloaded!

Thursday, May 22 2008 - , - 2 comments

I downloaded Resharper 4 beta today. I've been installing several versions of the Resharper 4 EAP as they have been released. Most have been pretty stable over the past month, which makes it no surprise that they released a beta. Yes its a later than most, including myself, expected to see a new version that supports all of the features of .NET 3.5 and Visual Studio 2008 (like LINQ, lambdas, and extension methods) but the EAPs have kept me going. Frankly I have gotten addicted to refactoring tools. Resharper has less eye candy that CodeRush and Refactor Pro, but its more efficient for me.

I'd love to see Developer Express really step up and compete with Resharper on their code analysis and other great aspects. There are some great features from both. But I digress ...

The beta version of Resharper 4 is out, and it supports LINQ and all of the other cool new toys. One thing I love about Resharper is the renaming feature and how it works with XAML. This has been awesome while writing my latest Silverlight projects.

Using the SHIFT - F6 key combination you can rename a variable, class, etc. But you can also do this in XAML and have it update both the XAML and the .NET code in the code behind. I did this below for my sample app where I renamed txtCompanyName to txtAnytext.

image

But one of the places that really makes Resharper shine for me is when I am writing code for objects and variables that I have not yet created. Now that this works for LINQ, Automatic Properties, and lambdas it makes my life much easier. For example, check out this query I wrote:

List<Person> personList = new List<Person>();
personList = GetPersons();
 
var query = from p in personList
            where p.City.StartsWith("S")
            select new {p.FirstName, p.LastName, p.Phone};

The Person class does not exist yet nor do the properties for it. Resharper helps create these using some shortcuts, most notably the ALT-ENTER key combination. Using this shortcut on the Person class reference, Resharper first creates the Person class for me. Then I use ALT-ENTER on the property name for City and it gives me this option to create the property:

image

I can repeat that for the other properties and fill in my class nicely. You can use the F12 key to go to the next "error" in the file. In this case the cursor will jump to the next property that I have not yet defined. So in this code I am basically hitting F12, ALT-ENTER, ENTER,and some TABs to fill in my class and its properties.

 
    public class Person
    {
        public string City { get; set; }
 
        public string FirstName { get; set; }
 
        public string LastName { get; set; }
 
        public string Phone { get; set; }
    }

It will create automatic properties for you or you can have it create regular property getters and setters. For me, I use a live templates to create my field and property combinations.

Anyway, give it a whirl if you have not tried it. Once you get used to some of the most common tools (Find Usages, Code Analysis, renaming, ALT-ENTER, etc.) you probably won't want to get rid of it.

ReSharper 4 EAP Roadmap

Friday, April 18 2008 - , - 0 comments

I've been downloading a new set of EAP bits for ReSharper 4 once a week since they opened access to the nightly builds and it really its coming together. The latest bits are much more stable than earlier versions and the features that are implemented are getting very close to being complete.

ReSharper v3 is in full release but does not support some of .NET 3.5 and VS.NET 2008's best features. Here is a roadmap that I grabbed from the ReSharper web site that outlines the highlights of Resharper v4.

If you have not grabbed the latest EAP bits, I suggest you give them a try. As a rule I only grab ones that are listed as tested successfully by JetBrains. Otherwise I avoid them :) I am now using EAP build 775 and have had not problems.

ReSharper 4.0 is the next major version of the product featuring a number of important enhancements:

  • Support for both Visual Studio 2005 and 2008
  • Comprehensive support for C# 3.0 language features, including:
    • New code analysis, context actions and quick-fixes
    • New refactorings (such as Convert to Extension Method, Convert to Automatic Property, Convert Anonymous Type to Named)
    • Updated IntelliSense
  • Many more intelligence and productivity features
    • Full set of refactorings available for VB.NET
    • New quickfixes and context actions for XAML files
    • Referenced assemblies are now taken into account in null-reference analysis thanks to external annotations. ReSharper is packaged with annotations for the .NET Framework assemblies
    • Code Cleanup — a tool for ensuring compliance with code guidelines and enhancing code structure
    • Complete Statement — a feature that will complete language constructs and get you ready to write the next statement

Resharper 4 EAP - Build 767

Sunday, April 06 2008 - - 0 comments

I've been monitoring the nightly EAP builds of Resharper 4 and the latest ones have been pretty stable. While all of the features are not in yet (most notably full support for LINQ), there is enough in here to really get a sense for how it is evolving. I installed build 767 a few days ago and its working pretty well.

There is lambda support (meaning it works with them and has some refactors), extension methods, automatic properties, and more. It does support some aspects of LINQ such as intellisense, which was my biggest problem with using v 3.1 with VS 2008. So its definitely on its way. i know VS 2008 has refactoring tools built in but Resharper just blows it away in terms of the productivity boost I get.

Here are some links where you can check out the latest EAP builds or the EAP notes .