1

I am doing reverse engineering of code that someone else wrote. When I search for all references of a variable or method and click on one of the results it beams my cursor right away on the line of code where it is used (which is a brilliant feature). Visual Studio shows me the class where this variable or method is used but not the method. The problem is that sometimes I end up in a huge method deep within, and the only thing I really need is the name of this cursed method.

Question: Is there a simple way to jump to the signature of the method in which the cursor is situated? Or any other way to find it out? (Besides scrolling dozens of pages of code upwards and likely missing it)

Mong Zhu
  • 23,309
  • 10
  • 44
  • 76
  • In VS2015 on the top right of the code editing window there should be a dropdown list that contains all the method in the current file. When you move from one method to another inside a file, the selected item in this dropdown list is updated accordingly. Therefore if you put the cursor in the middle of a method the dropdown list should automatically select the method you're in. Now if you open the dropdown list and select the method you're in, it should take you to the method's signature (sometimes I need to open the list two times to make it work) – Andrea Jun 06 '17 at 10:34
  • @Andrea that is a great answer you should write it as one, so I can accept it – Mong Zhu Jun 06 '17 at 11:06
  • Thank you, I wrote an answer adding a few details – Andrea Jun 06 '17 at 12:32

2 Answers2

1

Following the advice by Andrea I did a little research. Combined with this answer the outcome is this shortcut series:

Press Cntrl + F2 this will shift the focus to the dropdown menues above the code.

press 2 times Tab which will navigate to the dropdown menue for class elements as @Andrea suggested,

and hit ENTER to confirm the selection, which will automatically jump with the cursor to the signature of the method!

Mong Zhu
  • 23,309
  • 10
  • 44
  • 76
1

In Visual Studio 2015 on the top right of the code editing window there's a drop-down list that contains all the method in the current file:

enter image description here

When you move from one method to another inside a file, the selected item in this drop-down list is updated accordingly.

Therefore if you put the cursor in the middle of a method the drop-down list should automatically change the selected item matching the method you're in.

Now if you open the drop-down list and select the current method it should take you to the method's signature.

Andrea
  • 11,801
  • 17
  • 65
  • 72