Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio : Hotkey/way to step into f() in statement a()->f(b(),c(),d()) directly

While debugging, I am currently at this (next) statement :-

system<System_Body>()->executeFracture(calculateFracture(data));
                       ^^1               ^^2

How to step into executeFracture() or calculateFracture() directly and easily (without changing the code)?

Hotkey? Extension? Plugin?

My poor solutions

  • With F11, I have to step into system<System_Body>() first.
  • I can also jump to the source of executeFracture() and press ctrl+F10 from there, but it is not convenient.

Edit

MotKohn and TheUndeadFish advised using step into specific, thank!
Another similar thread (I just found later) tells that its hotkey is Shift+Alt+F11.
The hotkey make the choices popup, nice.

Edit 2 (Bounty Reason)

The existing answer (TheUndeadFish's) requires me to move mouse to a correct choice on the popup.
(or press up/down to select choice)

I wish for a more convenient approach, e.g. :-

  • I click at the word calculateFracture, so the caret (blinking |) move to it.
  • Then, I press some certain hotkey using keyboard,
    VS will step into calculateFracture() immediately.
like image 931
javaLover Avatar asked Jan 12 '17 04:01

javaLover


People also ask

How do I step into a function in Visual Studio?

Begin code stepping by selecting F10 or F11. Doing so allows you to quickly find the entry point of your app. You can then continue to press step commands to navigate through the code. Run to a specific location or function, for example, by setting a breakpoint and starting your app.

What is Ctrl F5 in Visual Studio?

F5 is used to start your project in debug mode and Ctrl-F5 is used to start your project without debug mode.

How do I run a line by line code in Visual Studio?

Click the Debug | Step Into menu item or press the F11 key to step into any property or method for debugging. You can then continue the line by line execution by pressing F10 or continue ...


2 Answers

Not a hotkey, but the closest thing I know of can be found on the right-click menu when your debugger is stopped on a line of code line that. You should be able to find an entry to "Step Into Specific" with a sub-menu giving the choice of all the functions from that line.

https://msdn.microsoft.com/library/7ad07721(v=vs.100).aspx

like image 89
TheUndeadFish Avatar answered Oct 13 '22 04:10

TheUndeadFish


Shift+Alt+F11 is the default global shortcut for "Step Into Specific", which will bring up a context menu of all the methods you can step into from the current instruction.

Of course, you can change the shortcut via Tools->Options->Customize...->Keyboard dialog.

Otherwise, there is no feature that allows you to step into the specific method under the editor caret. Sounds like a nice idea that you should put up on uservoice for Visual Studio.

like image 34
John Avatar answered Oct 13 '22 06:10

John