Tag Archives: resharper

Go To Implementation with View Call Hierarchy

Hands down, my favorite thing about ReSharper is that it adds Go To Implementation to the context menu for easy navigation to a function in a class that implements an interface. That’s kind of a wordy statement, so let me rephrase. Consider the example below. If I have a variable foo of type IFoo, ReSharper lets me right-click a call to foo.Bar() and jump directly to the implementation in either BasicFoo or ExtremeFoo.

interface IFoo
{
    public void Bar();
}

class BasicFoo : IFoo
{
    public void Bar()
    {
        Console.WriteLine("BasicFoo.Bar()");
    }
}

class ExtremeFoo : IFoo
{
    public void Bar()
    {
        Console.WriteLine("ExtremeFoo.Bar()");
    }
}

But what if you don’t have ReSharper? I used to think the next best option was Find All References, which does a good job of finding all the right places where you might want to look for an implementation. However, the implementations are mixed with the method itself and calls to the method, and the results returned by Find All References can become rather unruly.

find-all-references

Note that I said “used to think,” though. See that option under Find All References in the context menu, View Call Hierarchy? Use that. If you look at the Call Hierarchy for an interface method, you’ll get a group of implementations–exactly what I love about ReSharper’s Go To Implementation! You’ll also have a group of callers to the method which is what you get from another ReSharper nicety, Find Usages. Awesome.

call-hierarchy

Call Hierarchy is pretty amazing, and it’s kind of a bummer that I didn’t know about it until just now. Find All References still has its uses, but it’s taking a backseat to View Call Hierarchy in my toolkit. If you haven’t used it before, give it a shot–I bet you’ll love it, too.

Advertisements

Ultimate Guide to Speeding Up ReSharper (and Visual Studio) – JetBrains .NET Tools Library –¬†Confluence

After a few months off, I’ve re-added ReSharper to my toolkit. It’s a little pokey with my current solutions, though. I found some good info from JetBrains on speeding it. up. Enjoy!

Ultimate Guide to Speeding Up ReSharper (and Visual Studio) – JetBrains .NET Tools Library –¬†Confluence.

Disabling ReSharper

ReSharper is a great development tool that has a lot of offerings, and I generally don’t have complaints about it. The one thing that does irk me, though, is that it can cause solutions containing a large number of projects to load very slowly in Visual Studio.

I found that a simple workaround for this is to just disable ReSharper before opening the solution. This task is accomplished easily in two different ways. The first is to just go to Tools > Options > ReSharper in Visual Studio, and click the Suspend button. To re-enable the interface, click the Resume button in the same location. The second is to use the ReSharper_Suspend & ReSharper_Resume or ReSharper_ToggleSuspended commands in Visual Studio’s Command Window. (Bonus tip! If you need to suspend/resume frequently, map the commands to toolbar buttons.)