Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a VS shortcut to see the class definition of a variable?

When I press Ctrl+Left mouse button or F12 on a variable I get to the declaration of the variable.

Is there a shortcut like this to get to the class definition of the variable's type? So when I have a variable string functionCode I'd like to click functionCode anywhere in the program and get straight to the object browser showing me the string class.

Of course, this is most useful for self-defined classes and member variables. Sometimes I do not see the type of a member in a method at all - everywhere just var. To get to a class definition I have to go to the variable definition and from there to the class definition.

OK, this is all about saving one click ... but I am lazy ... is it possible?

PS: ReSharper solutions are welcome, too.

like image 205
tanascius Avatar asked Jun 10 '09 08:06

tanascius


2 Answers

The best way is by use of a mix between the code page and the Code Definition Window : Ctrl+W,D.

You can click on the item in code and view it in the Code Definition Window, then click on the base class in the code definition window and by using F12 it will take your code page to the base class definition.

like image 83
ChrisBD Avatar answered Jan 02 '23 13:01

ChrisBD


I just realized that is is possible to click Ctrl+Left mouse button or to press F12 on the var-keyword, too ...

like image 45
tanascius Avatar answered Jan 02 '23 13:01

tanascius