views:

881

answers:

2

Just a thing that annoys me.

When I right click on a method name a context menu appears with a "Find All References" option.

It works ok, except when you're implementing a Interface. Then it lists all references (maybe that's why it's called Find All References?), independent of the class that implements it.

Example:

interface IGetAThing<T>
{
    T Get();
}

public class ThingManager: IGetAThing<Thing>
{
    public Thing Get() {
        return new Thing();
    } 
}

public class ThingManagerReloaded: IGetAThing<Thingmabob>
{
    public Thingmabob Get() {
        return new Thingmabob();
    } 
}

When I search for all references of method ThingManager->Get I get a list containing all the references of ThingManagerReloaded->Get too.

What I would like is restricting the list of references to only one class references. Right clicking on the ThingManagerReloaded->Get method just shows a lists of ThingManagerReloaded->Get related uses, not including ThingManager->Get

Is that possible on VS2008?

+4  A: 

Third party tools such as resharper and coderush provide much better support for this kind of action. If your solution is small enough and machine beefy enough, you'll probably make plenty of use for these tools. To directly answer your question, I don't believe this is possible with VS2008 out of the box.

(You'll probably get a better answer from someone that has used these tools.)

Kevin Pullin
+5  A: 

ReSharper detects this and ask you if you want to find usages of the method from the base interface. If you decline it does what you ask for in the question.

Brian Rasmussen