Python Forum
debugging help on Visual Studio Code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
debugging help on Visual Studio Code
#1
Hi Team,

I want to take cursor to previous line on visual studio code editor.
tried on pycharm also it didn't worked.

Can we jump back to previous line.?...


Attached Snapshot of code.
Reply
#2
You cannot go to a previous line in any debugger that I am aware of. If you want to stop on the previous line, set a beakpoint on the previous line and re-run.
Reply
#3
Hi Deanhystad,

Thanks for the info,

Actually I come from VBA Background , excel automation via Macro. there that option was there hence asked.


Thanks
mg
Reply
#4
Can use Debug: Jump to Cursor command in command ctrl+shift+p
Click on desired line and use this command the debug will jump to line where cursor is placed.
Reply
#5
Hi snippsat ,

When clicked ctrl+shift+p ,

cursor is not moving to backword,
only I am getting pop window of command palate


Cursor was at line 16 and

I wanted to move to line 14, using ctrl+shift+p its not working. I am using Visual Studio Code.


Thanks
mg
Reply
#6
That is what you should get. Then you have to select Debug: Jump to cursor in the command palette.
Reply
#7
highlight target line, then click ctrl+shift+p
Reply
#8
Maybe it is just semantics, but I don't think jump to cursor can be used to go back to the previous command. Jump to cursor just sets the program counter. It doesn't undo the command, giving me a view of the program state prior to executing the previous command. If the previous command was "x = x + 1" and x is currently 5, jumping to the previous command does not restore x = 4. x is still 5.

If all you want to do is execute arbitrary commands, I'd just copy and paste the command into the debug terminal. If you want to run multiple commands in order I guess it makes sense to jump to cursor and then run to cursor.
Reply
#9
Quote:cursor is not moving to backword,
only I am getting pop window of command palate
Yes.and then have to start typing Debug: Jump to Cursor command and choose it.
[Image: RmDnC.gif]
Reply
#10
Hi snippsat,

Superrrrrrrrrrrb ! very happy , thanks for for your help, Clap

one more help if you can , In pycharm another ide how to achieve this thing.



Thanks
mg
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  My code works on Jupyter Lab/Notebook, but NOT on Visual Code Editor jst 4 1,052 Nov-15-2023, 06:56 PM
Last Post: jst
  How to set PYTHONPATH in Visual Studio Code? aupres 5 4,240 Aug-15-2023, 03:51 PM
Last Post: snippsat
  how do I open two instances of visual studio code with the same folder? SuchUmami 3 895 Jun-26-2023, 09:40 AM
Last Post: snippsat
  Visual Studio Code NewPi 3 1,063 May-16-2023, 11:13 PM
Last Post: snippsat
  Visual Studio Code venv ibm_db error mesi1000 7 2,833 Nov-13-2022, 12:36 AM
Last Post: snippsat
  Problem with importing Python file in Visual Studio Code DXav 7 5,123 Jun-15-2022, 12:54 PM
Last Post: snippsat
  Visual Studio Code Intellisense for Imported Modules Not Working hockinsk 1 2,732 Apr-23-2022, 04:41 PM
Last Post: deanhystad
Photo Visual studio code unable to color syntax on python interpreter tomtom 4 6,924 Mar-02-2022, 01:23 AM
Last Post: tomtom
  compile error Visual Studio Code jamie_01 2 1,698 Jan-25-2022, 09:36 AM
Last Post: Larz60+
  Calling python from c++ in visual studio pdk5 0 2,174 May-24-2021, 10:18 AM
Last Post: pdk5

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020