Files
popcyclical-blog-archive/posts/2010-01-10-resharper-5-beta-impressions.md

112 lines
10 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Resharper 5 Beta Impressions"
date: 2010-01-10T20:21:29.7145757-06:00
slug: resharper-5-beta-impressions
published: true
---
Being a [Resharper](http://www.jetbrains.com/resharper/) user for the past 5 years, I had to jump on opportunity to [try out the publicly released beta for the new 5.0 version](http://www.jetbrains.com/resharper/beta/beta.html?utm_source=jetbrains-dotnet-outlook4&utm_medium=resharper5beta-page&utm_campaign=resharper5beta).  Im currently using Visual Studio 2008, but Ill be glad to have the updated VS2010 support from Resharper once its released.  As for the changes in this major revision, Im excited to try out new code inspections, LINQ integration improvements, and native NUnit integration.
### Installation
- [![Resharper5BetaInstallComplete](../media/images/Resharper5BetaImpressions_7EC3/Resharper5BetaInstallComplete_thumb.png)](../media/images/Resharper5BetaImpressions_7EC3/Resharper5BetaInstallComplete.png)Install was quick and easy.  It uninstalled the version 4.5 and questioned me about killing a task that was getting in the way.
- Starting Resharper, Im greeted with a “License to version 4.0 is not acceptable”.  This is troubling in two ways:
- The license that I bought is for 4.5 C# Edition.
- Why does a beta need a license?
[![Resharper5BetaLicense](../media/images/Resharper5BetaImpressions_7EC3/Resharper5BetaLicense_thumb.png)](../media/images/Resharper5BetaImpressions_7EC3/Resharper5BetaLicense.png)
- For now, using “free evaluation” this seems to do the trick.
- As expected, the [AgentSmith plugin](http://www.agentsmithplugin.com/) is no longer installed (duh), but an updated version is available on their site.
### New Features
Id like to be pretty thorough in acquainting myself with the enhancements, so Ill touch on each of them from the [list here](http://blogs.jetbrains.com/dotnet/2009/10/resharper-50-overview/).
- **Structure Patterns** [![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb.png)](../media/images/Resharper5BetaImpressions_7EC3/image.png)
- Custom built code refactorings.  This could be a godsend for [brownfield development](http://en.wikipedia.org/wiki/Brownfield_%28software_development%29) enabling project-wide cleanup for stinky “[code smells](http://en.wikipedia.org/wiki/Code_smell)”.  The real power is in the “Placeholder” templating its much like the Live Templates but for refactoring.  The image onthe right has a pattern that I made to change from `timeSpan` to `happyHour`.  Needless to say, this is trivial (and useless!), but Im readily awaiting the next time I find a [code smell](http://en.wikipedia.org/wiki/Code_smell) I cant live with.
- **Project Refactoring and Dependencies View**
- Ive been waiting for the ability to mass-rename namespaces.  Resharper5 : check. 
- So what does “Project Refactoring” mean?  Does a project have a bunch of types declared in the same files?  After a few clicks, they can all moved into their own:[![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_3.png)](../media/images/Resharper5BetaImpressions_7EC3/image_3.png)
[![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_4.png)](../media/images/Resharper5BetaImpressions_7EC3/image_4.png) 
- Dependency View is basically “find usages by project” which could certainly be useful for larger solutions. 
- **Call Tracking, Value Tracking**
- Examines method, variable, field or property usage through the solution and finds where its being generated or called from, as well as the opposite - where its being used.  Its the static-analysis version of the call stack.
[![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_5.png)](../media/images/Resharper5BetaImpressions_7EC3/image_5.png)
- **Internationalization**
- Ive never worked on a project using [Internationalization](http://en.wikipedia.org/wiki/Internationalization_and_localization), but its bound to happen sooner than later. Resharper 5 adds the ability to move string to resource files as well as refactoring and inspection to support multiple languages.
- **ASP.NET**
- [![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_6.png)](../media/images/Resharper5BetaImpressions_7EC3/image_6.png)Syntax highlighting!  Check it out - unused namespaces inside ASP.NET markup will now appear grayed out, just as they do in source code.
- Templates for ASP.NET:
[![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_7.png)](../media/images/Resharper5BetaImpressions_7EC3/image_7.png)
- **ASP.NET MVC**
- [![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_8.png)](../media/images/Resharper5BetaImpressions_7EC3/image_8.png)View name autocomplete from the controller, as well as navigation to and from actions.
- … and navigation to Views.  **Shift+Click** on a view name to jump there:
[![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_9.png)](../media/images/Resharper5BetaImpressions_7EC3/image_9.png)
- *Aside: Our project has some calls to HtmlHelper.RenderPartial(“<ViewName>”) called inside of a class instantiated with an instance of HtmlHelper (its a Helper for HtmlHelper). Resharper cant resolve these names… but I wouldnt expect it to.*
- **IntelliSense Changes**
- In addition to performance improvements, completion can now done using abbreviated names based on [CamelHumps](http://animals.howstuffworks.com/mammals/question104.htm):
 [![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_10.png)](../media/images/Resharper5BetaImpressions_7EC3/image_10.png)
- [![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_11.png)](../media/images/Resharper5BetaImpressions_7EC3/image_11.png)**Bookmarks**
- Set and jump to bookmarks with quick keystrokes.  **Ctrl+Shift+[0-9]** to set, and **Ctrl+[0-9]** jump back.  **Ctr+~**  to see which bookmarks are available:
 [![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_12.png)](../media/images/Resharper5BetaImpressions_7EC3/image_12.png)
- **Upgrade to LINQ**
- Now this is pretty slick parses a foreach loop and its innards and [translates it to a single LINQ statement](http://blogs.jetbrains.com/dotnet/2009/12/resharper-50-preview-loops-2-linq/):
[![image](../media/images/Resharper5BetaImpressions_7EC3/image_13.png)](../media/images/Resharper5BetaImpressions_7EC3/image_19.png)
- **New and Improved Code Inspections**
- So, JetBrains says theyve added a bunch of new code inspections Im counting a little over 100 C# Context Actions in 5.0, where as 4.5 had closer to 80.  There appear to be some LINQ related ones in there. Theyve also called out that it can now highlight errors in XML comments (something which the [AgentSmith](http://www.agentsmithplugin.com/) plugin already did quite well).
- [![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_13.png)](../media/images/Resharper5BetaImpressions_7EC3/image_14.png)**Native NUnit Support**
- To be honest, Ive been using the previous Resharper versions NUnit support without complaint.  Im thinking that the that the improvements are “under the hood” it works just as well now as it did before.
- **XML Formatting**
- Inspection and refactoring support - “Reorder attributes” and “Collapse Empty Tag”, for instance.
[![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_14.png)](../media/images/Resharper5BetaImpressions_7EC3/image_15.png)[![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_15.png)](../media/images/Resharper5BetaImpressions_7EC3/image_16.png)  
- [![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_16.png)](../media/images/Resharper5BetaImpressions_7EC3/image_17.png)**External Sources**
- This promises to add navigation to referenced libraries that before could only be accessed at the higher namespace-class-method  level via Visual Studios Object Browser.  I poked around a bit on JetBrains site looking how to configure the symbol locations, but it doesnt seem to be documented yet.  Perhaps it might need to have the symbols locations populated in VS->Options->Debugging-Symbols, but perhaps not.
### Surprises
- Transparently imported settings from 4.5 horray!  Appears to be able to use the 4.5.resharper shared solution settings
- [![image](../media/images/Resharper5BetaImpressions_7EC3/image_thumb_17.png)](../media/images/Resharper5BetaImpressions_7EC3/image_18.png)Running “Find Usages” on a class is taking much longer in previous version it was instantaneous, now it appears to be scrounging through files instead of an index (could be External sources feature?)
- Quick navigate to Type/Filename/Symbol now match partial names no more needing to put in a “*” to match wildcards.
- In the day or two Ive been using it, I dont think Ive encountered any crashes.  This is a good thing the [multitude of errors being automatically reported](http://www.jetbrains.net/jira/browse/RSRP) seem to be going to good use.
### Wish List
- Javascript.  Being a dynamic language and all, itd be pretty difficult to implement the full set of navigation and refactoring helpers Resharper provides for C# and VB.  But oh, wouldnt it be slick if it could.
- Community sharing for code-style and and structure patterns. Theres already preference and template sharing with team members via a shared settings file. The next evolution is to extend this to the cloud and create a public library to exchange ideas with all Resharper users.
For every one of the new features Ive encountered in the past couple of days, Im sure there are two or three that I havent stumbled over yet.  Thats a great thing about this product utilizing a small subset of its features can greatly [streamline development and increase productivity](http://blog.briandicroce.com/2008/05/12/the-case-for-resharper-in-the-enterprise/).  Even after years of use, I am still happily surprised to discover new facets of the tool I hadnt noticed or investigated before.