5

I guess there's no built-in funcionality in Visual Studio for this purpose, but I would be happy if someone could direct me to (free one, if possible) extension that can do this.

    public class Program
{
    static void Main(string[] args)
    {
        Annoy annoy = new Tubo();
        annoy.DoTubo();
    }
}

public class Annoy
{
    public virtual void DoTubo()
    {
        Console.WriteLine("Annoy.DoTubo()");
    }
}

public class Tubo : Annoy
{
    public override void DoTubo()
    {
        Console.WriteLine("Tubo.DoTubo()");
    }
}

When I go with F12 (Go to definition), the carret navigates to Annoy.DoTubo() and not to Tubo.DoTubo().
I've found a plugin for the similar purpose (only for classes impelementing interface and not classes inheriting other classes) here.
I guess ReSharper and VisualAssist has this functionlaity, but I'm looking for a free one if there's any.

4
  • 4
    annoy is declared as an Annoy object; the DoTubbo method is being called from the Annoy class due to the variable declaration. How would VS know to go to the base class? Dec 27, 2012 at 16:28
  • 1
    @MetroSmurf moreover what if it's Annoy annoy = AnnoyFactory("Tubo"); Dec 27, 2012 at 16:48
  • @ConradFrix - that would just be annoying... Dec 27, 2012 at 17:03
  • what if his object was actually declared as an Tubo? the "go to definition" would still jump to the base class definition. Is there an actual way to navigate to the actual doTubo function that is attached to the object?
    – Denis
    Oct 21, 2021 at 3:46

4 Answers 4

9

In Visual Studio 2015, you can use the right-click Context menu on the base method to call "Go to Implementation" which will list out the methods overriding the function declaration.

0

One way to find it without any tool is to look for all references, that'll find the usages of the method.

A free one is the CodeRush by DevExpress

0

As far as I can remember there is build in "Find all references" in Visual Studio's context menu, so there is no need in third party tools

0

In Mac: From Definition to Implementation: Cmd+ F12

Hover to read the Definition of Method Implementation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.