You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi jahan01! It doesn't actually go back in time in the sense that it doesn't restore previous states. It really just defines the next point that the debugger will execute. If you set it to execute a piece of code that the debugger had already past through (by right clicking the editor on the line you wish to execute and selecting "Jump to Cursor"), all it will do is execute the code starting from that line, without changing its current state.
Thank you for the feedback, bersbersbers! That's a very good point, renaming it to "Set Next Statement" would be more consistent. I added this suggestion to issue #9875 and will talk to the team about it. 😊
+1 for Set Next Statement. Jump to Cursor sounds like an editor thing. I was just searching around to figure out what Set Next Statement was called and stumbled on this ticket :-)
Also I notice Alt-V isn't used at the moment as a key binding. If you think of 'pasting' the instruction pointer as setting it... felt nice to me anyway.
That's great feedback Squirrel (@gilescope), and a very good point as to why we should really rename it. Thank you 😊
Interesting that you mention Alt+V. When I use it in VS Code, it opens the "View" menu. This is nice in terms of accessibility, so I'd be a bit concerned of overriding it for set next statement command. But these are all great things for me to bring up to the team.
Just to give an update, the VS Code team is looking into adding "set next statement" as an alias to the "Jump to Cursor" command, so that it will show in the command palette when searching for "set next statement" 😊
Activity
jahan01 commentedon Feb 12, 2020
Its head line worthy feature, but yet it was released unannounced. I would like to know how does it go back in time to already executed expressions?
luabud commentedon Feb 12, 2020
Hi jahan01! It doesn't actually go back in time in the sense that it doesn't restore previous states. It really just defines the next point that the debugger will execute. If you set it to execute a piece of code that the debugger had already past through (by right clicking the editor on the line you wish to execute and selecting "Jump to Cursor"), all it will do is execute the code starting from that line, without changing its current state.
bersbersbers commentedon Feb 13, 2020
Since you ask:
I have been asking for this more than two years ago, and stopped hoping it would ever arrive. I had no idea it's implemented. I love it.
I like "Set Next Statement", which I believe I have been knowing under this name since 2009 in Visual Studio doing C# development:
https://docs.microsoft.com/en-us/visualstudio/debugger/navigating-through-code-with-the-debugger?view=vs-2019#BKMK_Set_the_next_statement_to_execute
It's also under this name that this feature is requested heavily (and/or provided) for various languages:
VS Code: microsoft/vscode#12514
VS Code: https://stackoverflow.com/questions/51552833/is-there-something-similar-to-set-next-statement-available-in-visual-studio-co
C#: dotnet/vscode-csharp#2785
C++: microsoft/vscode-cpptools#1025
C++: https://marketplace.visualstudio.com/items?itemName=ntoskrnl7.cxx-set-next-statement-extension
PTVSD: microsoft/ptvsd#18
luabud commentedon Feb 14, 2020
Thank you for the feedback, bersbersbers! That's a very good point, renaming it to "Set Next Statement" would be more consistent. I added this suggestion to issue #9875 and will talk to the team about it. 😊
gilescope commentedon Mar 10, 2020
+1 for Set Next Statement. Jump to Cursor sounds like an editor thing. I was just searching around to figure out what Set Next Statement was called and stumbled on this ticket :-)
gilescope commentedon Mar 10, 2020
Also I notice Alt-V isn't used at the moment as a key binding. If you think of 'pasting' the instruction pointer as setting it... felt nice to me anyway.
luabud commentedon Mar 11, 2020
That's great feedback Squirrel (@gilescope), and a very good point as to why we should really rename it. Thank you 😊
Interesting that you mention Alt+V. When I use it in VS Code, it opens the "View" menu. This is nice in terms of accessibility, so I'd be a bit concerned of overriding it for set next statement command. But these are all great things for me to bring up to the team.
luabud commentedon Apr 7, 2020
Just to give an update, the VS Code team is looking into adding "set next statement" as an alias to the "Jump to Cursor" command, so that it will show in the command palette when searching for "set next statement" 😊
luabud commentedon Aug 18, 2020
The alias was added in the June 2020 version of VS Code 🥳