DCSIMG
CodeRush Plugin - Navigate to Implementation Part 1 - .NET Geek

.NET Geek

"It is upon the Trunk that a gentleman works" - Confucius

CodeRush Plugin - Navigate to Implementation Part 1

In a post last week I mentioned a shortcoming of CodeRush navigation capabilities. On Friday (we don't work Fridays here) I decided that instead of sitting on my hands and complain I'll try to do something about it. I'll write a plugin for CodeRush that does this. I've written a few CodeRush plugins before, but I have never found the time to make something that I feel I can share with others. Not that the current implementation is a master piece, but it is small simple and works for what I want it to.

Because in my opinion it is such a pain to navigate the CodeRush object model I'll document here what I did and maybe the following will happen:

  • Someone will comment on the code suggesting a better way of achieving the same result.
  • Someone will use the code to implement his/her own plugin.

So here we go.

The first step is to define what we want to achieve. Take the following code.

public class CarTester

{

    ICar _car;

    public CarTester(ICar car)

    {

        _car = car;

    }

 

    public void TestCar()

    {

        _car.Drive();

        _car.PushBreaks(2);

    }

}

 

Let's imagine that there are many implementations of ICar such as Sedan, Trailer etc.

You are interested in working on the Truck Implementation. While getting familiar with the code you end up in the TestCar() method in CarTester. At this point you want to jump to the Truck implementation of ICar. So what do you do in Visual Studio to get to the Truck implementation? F12? It will only take you to the interface. You're out of luck. The goal of the plugin is to: "Position the caret on a method that's called on an Interface such as _car.Drive() and navigate to an implementation of your choice".

In the screenshot below you can see that the menu shows a list of all classes that implements the Interface ICar.

 

 

jump feature menu

 

 

In the next part we will start to walk through the code of the plugin.

 

kick it on DotNetKicks.com

Comments

.NET Geek said:

In the previous post we just defined what we want the plugin to do. Let's start to walk through the

# October 19, 2008 7:14 AM

.NET Geek said:

This is the last post in series on developing the navigate to an implementing method plugin. Here are

# December 4, 2008 12:33 AM

Mark Miller said:

Noticed these blog posts recently: Miha talks about the usefulness of CodeRush's Add Missing Constructors

# December 6, 2008 1:07 PM

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# June 18, 2009 2:10 PM

.NET Geek said:

For convenience, here are the binaries for the Navigate to Implementation CodeRush plugin. It is built

# August 30, 2009 2:05 PM

.NET Geek said:

Instead of posting a new a post every time a new build of CodeRush (and the plugin) becomes available

# November 12, 2009 4:34 PM

ivonne said:

Que frase necesaria... La idea fenomenal, excelente  

http://rsfiles.servehttp.com/  

shabab

# August 25, 2011 12:47 PM

Kenneth said:

So-so. Something was not impressed.

# March 28, 2012 2:37 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: