views:

501

answers:

9

Do you have a less well known but powerful feature of ReSharper?

A: 

It can be set to use the IDEA keymappings... great for us Java-migrants :)

Chris Kimpton
+1  A: 

What I really like about ReSharper is the Ctrl+, function, this shows a list of your last opened files. Really handy if you have a large solution with many projects, and you don't want to search for that one file which you just closed ;-)

+2  A: 

Templates are very powerful, and remarkably easy to set up.

For example, I use file templates and live templates for quickly adding unit test boiler-plate code. I have set up the following user file template named "Test Fixture" (using the dialog in ReSharper->Templates->File Templates).

using NUnit.Framework;

namespace $NAMESPACE$
{
  [TestFixture]
  public class $CLASS$ {$END$}
}

The NAMESPACE variable maps to the Default namespace for current file. The CLASS variable maps to the Current filename without extension.

When I right-click on a project in Solution Explorer I can now select "Add|New From Template|Test Fixture" from the menu. I type in the name of the test fixture class and I have the outline of the class added to my project, ready for me to add the tests.

For this, I have set up a Resharper Live Template called "test".

[Test]
public void $TESTNAME$() {$END$}

In my test fixture code I can just type the word "test" then TAB and I've got a new empty method for my test. I get a Resharper red box around the word "TESTNAME" where I enter the name of the method. When I hit return, the cursor jumps to where I put $END$ in the template, so I'm in the right place to start writing the test.

Lee
+4  A: 

I love autocompletion that works with CAPS. I.e. typing "IOE" in type completion will show InvalidOperationException.

Also:

  • File header that updates on reformat
  • Ctrl+N - to navigate to any class
  • Ctrl+Shift+N - to jump to any file
Rinat Abdullin
+3  A: 

My favorite is simply the Resharper intellesense because you simply enter the capital letters of the method / class / namespace / property you want.

For example if you have a customer class with the property SomeLongPropertyName you can just type

Customer.SLPN

and the intellesense will give you a list of properties / methods where capitalization matches the letters you've typed.

This works for everything in Resharper, for example press ctrl-T and type the upper case parts of a class name and it'll match them too.

Matthew Rathbone
+4  A: 

I like being able to override Equals, and resharper will be able to add all the equality overriodes and asks what properties you want to base the hashcode off of and will implement it fro you.

Example:

public override bool Equals(object obj)
{
    if (ReferenceEquals(null, obj)) return false;
    if (ReferenceEquals(this, obj)) return true;
    if (obj.GetType() != typeof (RsMessengerMsg)) return false;
    return Equals((RsMessengerMsg) obj);
}

public bool Equals(RsMessengerMsg obj)
{
    if (ReferenceEquals(null, obj)) return false;
    if (ReferenceEquals(this, obj)) return true;
    return obj._messageUID == _messageUID && obj._userUID == _userUID && Equals(obj._username, _username) && Equals(obj._message, _message) && obj._time.Equals(_time);
}

public override int GetHashCode()
{
    unchecked
    {
     int result = _messageUID.GetHashCode();
     result = (result*397) ^ _userUID;
     result = (result*397) ^ (_username != null ? _username.GetHashCode() : 0);
     result = (result*397) ^ (_message != null ? _message.GetHashCode() : 0);
     result = (result*397) ^ _time.GetHashCode();
     return result;
    }
}

All i had to do to get this was override Equals, and use Alt Enter on the Equals method name and choose 'Generate Equality Members'

mattlant
A: 

Ctrl-Shift-F1 shows popup help for the currently selected symbol. The appearance is much better than the built-in tooltip help, and includes hyperlinks to related types.

Lee
+1  A: 

You can use wild cards (? and *) in type and file navigation.

Rinat Abdullin
+1  A: 

Right clicking on a reference will allow you to find dependent code.

Mark