Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an opposite to 'go to definition' in Visual Studio?

I can right click a variable/method/class etc and click 'go to definition' and it will show me where that variable/method/class was created.

Is there a way to do the opposite of that? Is there a way to see where that variable/method/class is used in your C# project?

like image 734
thatOneGuy Avatar asked Jun 19 '15 16:06

thatOneGuy


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!

How do I go back to F12 in Visual Studio?

In Visual Studio Code, you can also use Alt + Left-Arrow to return to your original location in the source code after navigating with F12.

How do I go back and forth in Visual Studio?

By default, Alt+Left navigates back, and if you remove the Alt+Right shortcut for Edit. CompleteWord in Microsoft Visual Studio, Alt+Right navigates forward.


1 Answers

Right click, find all References. Or use Ctrl+K+R

UPDATE

I know where the Ctrl+K+R vs Shift+F12 confusion stems from. For developers that set up their environment settings for C#, Visual Basic or JavaScript, Ctrl+K+R is the keyboard shortcut that shows up in context menus. Shift+F12 is the keyboard shortcut that shows up in context menus when the environment settings is set up for Web Development or General.

To change the environment settings:

Tools > Import and Export Settings > No, just reset settings, overwriting my current settings > General / JavaScript / Visual Basic / Visual C# / Visual C++ / Visual F# / Web Development /Web Development (Code Only)

like image 178
Michael Buen Avatar answered Oct 25 '22 00:10

Michael Buen