Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Please search existing issues to avoid creating duplicates. --<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: --Hi, First of all, Happy new Year! I submit here an issue regarding to in Debug View. <!-- Use Help Report Issue to prefill these. --- VSCode Version: Latest (1.52.1) OS Version: Win10 x64 Steps to Reproduce: a Debug Configuration 1 (my case is from a custom DebugAdapter, this problem occurs as well with C/C++ Extension) a second Debug Configuration (it can be a different type from previous one) a session (Stop or Step) session has now focus but variables are not revealed. Variables are correctly displayed when switching one session to another, but they are not displayed after a session ended. Regards. EDIT: If you try the same steps with 3 sessions: , you will see that your current session does not display variables. you switch to the 3rd session, it will display variables associated. you switch again, it will show you variables associated. <!-- Launch with to check. --Does this issue occur when all extensions are disabled?: N/A : Need at least one extension to debug. EDIT2: This ""problem"" is due to lost focus, which happens when debuggee stops. It can be an expected behaviour. If so, I can close this issue.
Happy New Year, Yes I can reproduce this with js-debug adapter which has child sessions. The issue is that when a debug session is stopped we do not focus the stack frame, but only the session. What this means is that the variables does not display anything since a stack frame is not focused. I acknowledge that this is a bug. And I think might have hit something similiar in the past
just to check if you can still reproduce this with latest vscode insiders? Since we have improved automatic switching of focus of sessions?
Using I can still reproduce this issue. When a session is closed, no current session takes the focus. It does not show variables nor the arrow in the glyph margin. https://user-
this works just fine for me with js-debug and latest Insiders. Here's a gif where I am doing the same thing as you. In case you can still reproduce this, can you please F1 developer tools sources and place a breakpoint and let me know what you see? Since that code should handle this case exactly. !
I used latest version of Insiders (and Code OSS) and it is not working. Sadly, it reveals a new bug when I do stepping using multi session :( For the current bug, I hope it is still the line you asked. This breakpoint is only triggered when I close the second session and not the first one. ! I did try by changing the test in line 661 by this line !
Now I pushed the fix for the new issue you found. It would be great if you can re-try tomorrow with vscode insiders and try to investigate more. The actual line is this one This is a permalink, so the line should be definite. Just try to figure out how the focus behaves, and if the focus is properly passed to the remaining . Thanks
I did some testing, here is my understanding. It looks like informations gathered from this line is correct, and the needed session is correctly focused. It returns a correct (which the first one available) and defines the session which will capture stepping commands and console. However, we are setting a focus on a which is not able to focus to a given couple. I tried by getting all the objects returned by and it behaves as we want here. Before: After: With further testing, to display these variables we only need to focus a . Focusing a is a plus. Here is a record with the code https://user-
that looks like a reasonable change. Would you like to create a PR with that change, or would you like me to push it? Thanks a lot for a great investigation
I opened a PR about this change
Awesome. I merged it. Should be in insiders tomorrow. Let me know how it goes once you try it out with the built vs code.
Great, adding verified label.

Discussion:
const focusedSession = this.viewModel.focusedSession; if (focusedSession && focusedSession.getId() === session.getId()) { <del> const { session } = getStackFrameThreadAndSessionToFocus(this.model, undefined, undefined, undefined, focusedSession); this.viewModel.setFocus(undefined, undefined, session, false); </del> <ins> const { session, thread, stackFrame } = getStackFrameThreadAndSessionToFocus(this.model, undefined, undefined, undefined, focusedSession); this.viewModel.setFocus(stackFrame, thread, session, false); </ins> } if (this.model.getSessions().length === 0) {