VSCode-R-Debugger
VSCode-R-Debugger copied to clipboard
Enhancement when set a break point at blank line
Describe the enhancement
When I set a breakpoint at the line with no command, the R debugger would automatically run the following lines with commands. For example, set a breakpoint at the blank line before K=1
with the following code. A gif will be posted to show this.
fo <- function(x){
x + K
}
bar <- function(x,y){
fo(x + y)
}
K=1
print(bar(1, 2))
Thanks for raising this issue.
To an extent, this is intended, since stopping at an empty line might be a bit confusing (since nothing would happen if you click "Step Over (F10)").
Apparently, the python extension handles this by moving the breakpoint to the previous (non-empty) line. Something like this should be possible here. Is this the behaviour you would expect?
Also, note that a breakpoint always pauses the execution before running the specified line of code, so in your example you could safely set the breakpoint in line 9.
Rstudio handles this by moving the breakpoint to the next (non-empty) line. I prefer this as well. But it is ok to follow the python extension.