Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakpoints stay on their original line number (do not follow statements) when code is edited during a debug run #2389

Closed
mawright opened this issue Aug 14, 2018 · 1 comment

Comments

@mawright
Copy link

This may be an upstream issue with the core VSCode. I don't know Javascript so I'm not able to see if it happens in the built-in debuggers.

Environment data

  • VS Code version: 1.26.0
  • Extension version (available under the Extensions sidebar): 2018.7.1
  • OS and version: Ubuntu 16.04
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): Conda
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

When lines are added/removed in the source code while a debug run is active (i.e., when paused at a breakpoint), all breakpoints stay at their line number and are not moved up or down as lines are added or removed. This means that when the debug run is relaunched, any breakpoints below added/removed lines will be on a different statement than when they were created.
This also means that the behavior of how breakpoints move is different between whether you are editing code while debugging or not. During normal operation, breakpoints move with their statements. During debugging, breakpoints stay in place.

Expected behavior

If code is edited during debugging, breakpoints follow their original statement (moving down 1 line for each line inserted above and up 1 line for each line deleted above) after the debug run is ended.

Steps to reproduce:

  1. Non-debug behavior: Breakpoint moves with its original statement c = 3
    works_nondebug

  2. Debug behavior: The statement c = 3 begins at line 5, is moved down two lines, but the breakpoint stays at line 5, even after the debug run is completed.
    doesntwork_debug

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Nothing

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

Nothing

@mawright mawright changed the title Breakpoints stay on their original line number when code is edited during a debug run Breakpoints stay on their original line number (do not follow statements) when code is edited during a debug run Aug 14, 2018
@brettcannon
Copy link
Member

This actually isn't under our control and affects TypeScript debugging as well. You can try filing a bug upstream with VS Code itself if you want.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants