Question

When debugging, a trick I do whenever I want to exit the current method without running of its any statements, I move the current execution pointer to the end of the method, then click F10/11.

Is there a keyboard shortcut (or can I program one) to accomplish this?

(I don't mean shift-F11 (step out) - that does run all the code until the method's end, which I do not want).

Was it helpful?

Solution

The following sequence of keystrokes works for me (tested in Visual Studio 2008); I was able to record them as a temporary macro and play them back successfully:

  1. Ctrl+M, Ctrl+M (Edit.ToggleOutliningExpansion: collapses the current method)
  2. Right arrow (skips past the collapsed parameter list)
  3. Ctrl+] (Edit.GotoBrace: goes to the opening brace)
  4. Ctrl+] (Edit.GotoBrace: goes to the closing brace)
  5. Ctrl+Shift+F10 (Debug.SetNextStatement: sets the next statement to the closing brace at the end of the function)
  6. F10 (Debug.StepOver: leaves the method)

OTHER TIPS

AFAIK that's the only way to do it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top