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).
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:
Ctrl+M, Ctrl+M(Edit.ToggleOutliningExpansion: collapses the current method)Right arrow(skips past the collapsed parameter list)Ctrl+](Edit.GotoBrace: goes to the opening brace)Ctrl+](Edit.GotoBrace: goes to the closing brace)Ctrl+Shift+F10(Debug.SetNextStatement: sets the next statement to the closing brace at the end of the function)F10(Debug.StepOver: leaves the method)