Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go To Definition in Visual Studio - Interfaces

Is there a way to show all classes that implement a certain method from an interface. If you click F12 in Visual Studio on a method call, you go to its definition. If its an interface, then you still have to go and look for the class. I would be nice to be able to get a popup and choose one of the classes which implements the interface... Does that exist?

like image 450
Lieven Cardoen Avatar asked Feb 04 '10 11:02

Lieven Cardoen


People also ask

How do you get to define in Visual Studio?

Ctrl-click Go To Definition Ctrl+click is a shortcut for mouse users to quickly access Go To Definition. Symbols become clickable when you press Ctrl and hover over the type or member. To quickly navigate to the definition of a symbol, press the Ctrl key and then click on it. It's that easy!

What is peek definition in Visual Studio?

You can use the Peek Definition command to view and edit code without switching away from the code that you're writing. Peek Definition and Go To Definition show the same information, but Peek Definition shows it in a pop-up window, and Go To Definition shows the code in a separate code window.

How do you open the implementation method in Visual Studio?

Choose Navigate | Go To Implementation in the main menu, press Ctrl+F12 , or click the symbol while holding Ctrl+Alt keys. Note that in Visual Studio 2017 and later, the Ctrl+Alt -click is used for adding multiple carets.

Why is definition disabled in Visual Studio?

Answers. Don't close Visual Studio but close all the files and open them again by clicking on the file in the solution. The file might have been opened by Source Safe or you maybe opened it from Windows Explorer. In this case the file doesn't get assosiated with your solution and the Go to Def.


1 Answers

And without installing any Visual Studio extensions...

If you right click the method and select 'find all references' or press f12 + shift a list of implementations will be returned in the Find Symbol Results; ordered by interface, class, method call.

Update

Install VS 2015, right click - GoToImplementation (if you have one implementation for the interface, VS will navigate directly to it, if you have two or more, VS will list them)

like image 82
atreeon Avatar answered Sep 21 '22 16:09

atreeon