40

I have used Visual Studio 2008 to 2017, all having this feature as shown below:

enter image description here

The yellow arrow(debug pointer) which can be used to manipulate executing line(or execution flow) while debugging, thus allowing the user to move the arrow simply by using mouse.


In Visual Studio Code, the arrow is there to show the executing line as shown below:

enter image description here

But it(debug pointer) can't be manipulated or moved using mouse, to change the executing line(or execution flow) while debugging.

Is there any setting which has to be changed in Visual Studio Code to enable this feature?

5 Answers 5

45

Right click on the line you want to run in the start position, and "jump to cursor".

Right click on the line you want to run, and "jump to cursor".

Sign up to request clarification or add additional context in comments.

5 Comments

It's nice to see this made it's way in. Thanks for updating this years later!
I'm not seeing it debugging javascript on my node app.
Is there a keyboard shortcut for this? I'm looking for the equivaluent of Ctrl + Shift + F10 in Visual Studio proper.
@user1007074 I was able to add Ctrl + Shift + F10 directly using the Keyboard Shortcuts menu, I do not believe it conflicts with anything.
Note that this does not appear for all languages, notably Javascript and Python, but you can use (and assign a shortcut to) the set next statement command. Click on the line you want to jump to, CTRL+Shift+P, type the command and go. On another note, I haven't tested if the useful .NET Edit-and-Continue functionality works though, and for sure it's not supported in Python yet.
5

You are looking for Set Next Statement option, which is not yet available.

Please follow this Git Issue for latest.

1 Comment

This is not the answer(or a workaround) I was looking for, but u can have my upvote instead :)
3

There is no as such feature available as per the documentation. Check here on official link enter image description here

1 Comment

It should work: the arrow's tooltip says "To change which statement is executed next, drag the arrow". Also it DOES work, but only sometimes, there is no logic to it that I can see. Other posts suggest that you have to enable the Text Editor option for "Drag and drop text editing", but it doesn't seem to make any difference for me in VS 2019.
3

Inside VsCode, go to 'File=>Preferences=>Keyboard Shortcuts' Ctrl+K, Ctrl+S in my VsCode opens this dialogue Keyboard settings - keybindings list

Now type: 'set next statement' as the Command to search for inside keyboard shortcuts. Click inside to set a shortcut key,such as 'Ctrl+Shift+F10'

Set next statement

Now you can just select another line when debugging (statement actually) and hit they shortcut you just set up such as 'Ctrl+shift+f10'. Very keyboard friendly and a good alternative until there is a VsCode version where you can do as in Visual Studio, just drag and drop the 'breakpoint indicator' to the left of the editor up or down. I guess VsCode probably will implement this sooner or later..

Debugging code and setting next statement via shortcut

1 Comment

This answer didn't solve my problem but it pointed me in the right direction. I have used the jump to statement feature with Visual Studio for over a decade - but it wasn't possible with VS Code. So I looked here for a solution. All of the above methods didn't work and the menu option is simply not present. After setting the Ctrtl+shift+F10 as you described I was able to configure the key sequence. But when I used it the true problem was revealed. I received the message: "Set next statement is not supported by the current debugger." Boo. Hiss. Microsoft. Thanks for the tip.
0

Given answer "Jump To Line" maybe the answer, but as a workaround I use debug console. I run the needed line over there, by copy/paste, so i can manipulate variables.(if the functions are not async)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.