microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.2k stars 28.06k forks source link

Debugger line highlighter not updating when number of lines in file being debugged changes #17337

Closed BenSandeen closed 5 years ago

BenSandeen commented 7 years ago
Extension Author Version
rainbow-brackets 2gua 0.0.6
output-colorizer IBM 0.0.8
indenticator SirTori 0.2.1
code-gnu-global austin 0.2.1
codecover bradleymeck 1.1.0
python donjayamanne 0.5.5
code-runner formulahendry 0.6.3
cs-syntax-visualizer itn3000 0.0.2
Hg jake-coltman 0.0.4
clangcomplete kube 0.0.5
vscode-clang mitaki28 0.2.1
cpptools ms-vscode 0.9.3
csharp ms-vscode 1.5.3
sublime-keybindings ms-vscode 1.8.0
indent-rainbow oderwat 0.4.1
vscode-icons robertohuertasm 4.1.0
trailing-spaces shardulm94 0.2.11
shader slevesque 0.2.2
cmake twxs 0.0.15
cmake-tools vector-of-bool 0.8.6
clang-format xaver 1.0.0

Steps to Reproduce:

  1. Run debugger (I'm currently using python, but I think this is language agnostic)
  2. Edit the file you're debugging to change the number of lines above the line the debugger is on (I used another text editor, but I think I've seen this occur if I edit the file using VSCode)
  3. Now the debugging line indicator should be displaced from the actual line that is being debugged by a number of lines equal to the number of lines inserted
weinand commented 7 years ago

The VS Code debugger ('node') does not yet support 'live edit'. This means that whenever you edit source while a debug session is active, the debugger is not aware of the source change and line and column locations are not displayed correctly. To make the user aware of this we show breakpoints in grey after a source edit.

@isidorn currently the yellow current line is adjusted after lines are inserted or deleted. This is confusing because the user thinks that the debugger has picked up the changes (which it didn't). And another 'step' makes the current line jump back to the original location. I suggest that we do not adjust the current line when the editor is dirty.

@roblourens I noticed that 'node2' shows some erratic behaviour when inserting lines while a debug session is active. Are you already trying to support 'live edit'?

isidorn commented 7 years ago

@weinand the yellow current line is implemented using editor decorations and this is just how editor decorations work - namely they are tied to the location in the edior and as that location changes the decorations automatically update. Also not adjusting a current line would have the downside of making it confuzing for adapters that do support live editor.

Closing as will not fix

weinand commented 7 years ago

@isidorn if the current implementation does not work for us, then we will have to fix this on our end.

If we start supporting live editing, then we will have to address your second argument.

roblourens commented 7 years ago

No, I'm not doing anything to support live edit.

roblourens commented 7 years ago

node2 doesn't look any more erratic than node-debug to me. It's what I expect, if I insert a line, then the highlight is off by a line.

isidorn commented 6 years ago

I still have no immediate plans of fixing this. @weinand leaving up to you to close if you want

vscodebot[bot] commented 5 years ago

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!