-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Run to Cursor doesn't actually run #104385
Comments
Setting a breakpoint at the cursor position is actually how VS Code implements "run to cursor". However, staying on the line it's on is not a desired behavior. I can't reproduce this using a simple Node script -- can you collect a trace log using the instructions in the issue template? |
Thanks for the emailed log! In looking for the second issue you mentioned, I'm seeing:
|
I may as well have had... it was yesterday. I mean it has never menaged to run on it's own, so if there was a
yeah, I know. this is actually a slight problem in the default debuggers (node, chrome) as well: when the debug session is able to reach the "run to cursor" point - it will delete it right away, which is fine, but if it is not reachable - the breakpoint stays. forever. and this is not optimal, since when you are jumping between files - you can forget to clear it manually. and then it may break there during an unrelated dev cycle and you'll wonder "why is this breakpoint here? what did I try to resolve with it?" the optimal behavior would be to clear the run to cursor bp on debug session termination and/or restart, regardless of whether it was reached or not. I can make it a separate request issue, but since you are going to be fixing it regardless and it may as well be a part of the problem - maybe you can tackle this as well... |
Yea that would be helpful to make sure where the issue lies and avoid barking up the wrong tree. Thanks! |
I let it sit fo ~20 secs before terminating. if that helps, both the true breakpoint and the RtC one are in the same scope, but the scope itself is an async callback ( |
ret = userPromise.then(function (user) {
var render // true breakpoint here
;
if (user) {
if (req.body.ajax) {
locals.user = user;
} else {
render = {
'redirect': '/admin'
};
}
} else {
render = toRender;
}
return render; //run to cursor here, at the line start
});
|
Thank you for the log, that's helpful. I can't repro locally, but this seems like a bug in vscode rather than the debugger. The sequence above is accurate -- VS Code sets a breakpoint on line 107, which is verified by the child session (not the wrapper parent session, but that doesn't cause an issue locally...) but never sends a {
"command": "setBreakpoints",
"arguments": {
"source": {
"name": "page.js",
"path": "<snip>",
"sourceReference": 0
},
"lines": [
94,
107
],
"breakpoints": [
{
"line": 94
},
{
"line": 107,
"column": 17
}
],
"sourceModified": false
},
"type": "request",
"seq": 24
} {
"seq": 1939,
"type": "response",
"request_seq": 24,
"command": "setBreakpoints",
"success": true,
"body": {
"breakpoints": [
{
"id": 2,
"verified": true,
"source": {
"name": "page.js",
"path": "<snip>",
"sourceReference": 0
},
"line": 96,
"column": 17
},
{
"id": 5,
"verified": true,
"source": {
"name": "page.js",
"path": "<snip>",
"sourceReference": 0
},
"line": 107,
"column": 17
}
]
}
} cc @isidorn. I can take a look later this iteration if you don't get to it. |
@Spown since you have repro steps maybe you just put a breakpoint here and try to figure out what is going on
The only way for vscode to not send a continue is if the |
So, at first I had a couple problems with extensions microsoft/vscode-js-debug-companion and JavaScript Debugger (Nightly). I removed Anyway after that the console is basically completely clean. No null pointer exceptions.
Debugging the Thank you. |
@Spown thanks for trying it out, however I believe that error is only there during debugging. It is not an actual issue. @connor4312 if there is no null pointer exception or other excpetions then I am not sure how is it possible that VS Code adds a breakoint and does not send a continue. I am open for ideas
|
I am not sure what is to be done here. |
I was able to replicate this with some contrivance, but maybe not an especially hard-to-hit scenario: if the run-to-cursor was issued for a file in a different debug session than the one I currently had focused in VS Code. Example: https://memes.peet.io/img/20-08-4bd8aaad-7962-420c-a3eb-16e9ac77bd34.webm
Maybe instead of issuing the @Spown does this sound like it might have been the scenario you were running? |
Aaaa. So this only happens if you have two sessions and you do the So I would simply not fix this. Sounds very rare and nothing gets broken. |
Yea, this is a single report and very much an edge case. I'm fine backlogging unless we get more reports.
This can be a halting problem since breakpoint verification can be asynchronous. Verification used to be 100% async in js-debug until earlier this year |
well, I'm not using I have only 1 Also I wouldn't call it an edge case - since debugging both back- and front end simultaneously belongs to a typical full stack developer dev loop. thank you. |
Thanks for the info, it sounds like you're hitting the same scenario, in one way or another. |
Concerning the rarity of the report... I don't think many people use RTC and even when they do and the problem occurs - hitting |
the focused session is always the |
I mean focus in the "call stack" view. The fact that this problem doesn't repro if you only run a single session makes me strongly suspect that this is what you're running into. |
isn't it the same/proxy? switching in "call stack" - switches the in the widget and vice versa... |
I've implemented the following heuristic:
|
"Run to Cursor" just sets a breakpoint (obviously not a desired behavior) at the selected line and stays on the line it is currently on (even less so desired).
If I switch back to the default debugger (
debug.javascript.usePreview=false
) - it works as intended.VS Code Version: 1.47.3
Additional context
I am debugging a plain NodeJS, not TS or Browser JS. Also tried Insiders.
The text was updated successfully, but these errors were encountered: