Is there a "Go to type variable" function for C # in Visual Studio 2015 or a free plugin that does this?

void MagicalFunction(MagicalType magic) { ... magic.Poof("something"); ... var foo = magic.GetFoo(); ... } 

Pressing the hotkey on the magic variable will be guided by the definition of the MagicalType type.

Pressing the foo hotkey will switch to the definition of the type foo , which is not directly visible due to the type input.

The Resharper plugin has this feature (called Go To Type of Symbol ), but is there a built-in alternative or free extension that does this?

+8
c # plugins visual-studio-2015 hotkeys
source share
4 answers

The function you are looking for is "Navigate to."

For some strange reason, the keyboard shortcut has been removed from VS 2015. You can see this by going to the "Edit" menu. The option will be there, but no shortcut has been assigned to it.

You can fix it manually. Default value:

CTRL +,

Go to "Tools"> "Options"> "Environment"> "Keyboard", find "Edit .NavigateTo" and reassign the shortcut. Then you can place the cursor on the variable and click on the shortcut, and a tiny window will be superimposed in the upper right corner with possible candidates, one of which is the type definition.

+5
source share

Sorting.

You can press F12 on β€œmagic” to go to its definition, and then again F12 to go to its class.

Also, until you can get anything meaningful F12 on β€œfoo”, since it will just highlight the line you are already in, if you F12 from β€œvar” immediately before foo, it will move you to the Foo class, even if this type is inferred.

+4
source share

Right-click on the keyword "var", select "Go to Definition" from the context menu, and it will take you to the definition of the type of the displayed variable type. I have some tools, such as Productivity Power Tools, that have been mentioned, so I'm not sure if this option is available through pure VS2015.

+4
source share

Performance Power Tools has the "Ctrl + Click" Go to Definition This extension gives the editor a web browser by adding interactive hyperlinks to the characters in your code by holding down the Ctrl key.

https://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef

it does not work in the first case, but works very well when you press "var" in the second case

0
source share

All Articles