-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
debug: support suspendDebuggee #134412
Comments
cc @weinand |
Yes, VS Code does not yet surface |
You could have more options in the toggle: Stop (default for launch), Disconnect+Resume (default for attach), Disconnect+Suspend (new option). |
This has come up again for us. Anything in the works by any chance to add the UI option for suspending or restarting the debuggee on disconnect? |
@polinasok you are talking about this, right? |
This is the control you added to support |
Just wanted to add that with three different options (and possibly even with two) it might be a good idea to have the end-session options side-by-side instead of having the users toggle with a key. EDIT: Writing this made me realize that adapters like ours might need to communicate |
@polinasok thanks for the additional info. Here are the three possible
Now we have to find a new UX because the existing alt-modifier approach doesn't work for three options. @roblourens @connor4312 @polinasok any ideas? |
Yes, a dropdown button could work. @polinasok should the button remember the last choice or should it always fall back to the default action? |
Hmm, that's a good question. I can think of pros and cons for both... |
Thank you for adding this to the April rotation. We are very much looking forward to this feature instead of defining private clunky workarounds. |
What are these |
@hyangah "Disconnect on launch" means the same as the "Disconnect on attach": don't kill the debuggee but just disconnect the debugger from it. With the "... Resume" and "... Suspend" variants you can control whether the debuggee will continue to run or stays in the suspended state. What to do with the debugger I don't know because VS Code knows nothing about debuggers. Debuggers are an implementation detail of a debug adapter or debug session. I suggest that you ask @polinasok for details. |
Thanks @weinand - Yes, I understand VS Code knows nothing about debuggers. @polinasok do you plan to enable this capability only for "attach" request type in delve? (maybe send the capability update event?) I don't think this is a viable option for launch requests in Go extension but causes user confusion. |
@hyangah There are already two options for launch, regardless of |
Thanks @polinasok. Great to hear that this is enabled only on One more UX question:
@weinand It looks like DAP spec's "Disconnect Request" section needs update to reflect this change #134412 (comment) . Currently the spec says:
|
@hyangah I think the spec covers that already: |
@roblourens Looks great - ship it! |
What will alt do? How will one get to Stop in this case? Also will the options differ, when state is running vs stopped?
Stopped showing
|
Oh, an what will this look like if |
The "Alt" modifier key will temporarily flip the button between Stop and Disconnect without the need for selecting from the drop down. It is basically a shortcut and exists for backward compatibility (with user's muscle memory).
No, we do not want to track suspend state in VS Code.
if there are no options enabled, then the button will work like before: no dropdown. |
I am clearly missing something. Isn't square used for Stop and plug used for disconnect with alt?
You do to decide when to enable pause and when to enable continue and step controls, don't you?
I understand that. But without the extra details, it is not clear that one option guarantees suspended state while the other option does the opposite as opposed to preserving whatever state things are in and only disconnecting.
Can you please help me populate this, so we are all on the samee page?
|
with
with
Please note: I'm assuming that the dropdown always shows all available actions and that the first actions is the same as the default. |
Thanks @weinand, I wrote a similar table for myself yesterday 😅. I just pushed yesterday's change before I looked at the thread but it's mostly there now.
|
Another follow up about "Disconnect" and "Disconnect and Suspend" labels. Imagine a user that is paused on a breakpoint. What should they expect from "Disconnect"? Should they expect it to resume execution or leave things as is? I think it is important to highlight what state the user can expect execution to be in when they are done clicking. I think "Disconnect" is too ambitious. The options should be really be something like "Disconnect Resumed" and "Disconnect Suspended". |
"Suspend" is actually interesting because we don't use that term anywhere else, how did we pick "Suspend" and not "Pause" or "Stop"? Of course the DAP and UI terms diverge already and we can use something else in the UI if it makes sense. |
For me, I guess I assume that if I disconnect a debugger, the debuggee will resume by default. It seems enough that the opposite case ("Disconnect and Suspend") is spelled out, and I haven't heard of users being confused by that yet. |
@roblourens answers for your questions:
I mean the "default" action provided by the top-level button part of the split button (as opposed to the dropdown part).
Yes, that's ok.
Yes, correct. For backward compatibility we should not assume that a DA supports "disconnectdisconnect(terminate=false)" for the "launch" case if
Good observation: I agree we use "Pause" elsewhere but actually I prefer "Suspend" over "Pause". So if we want to unify terms I would rename "Pause" to "Suspend"... (but that's my personal preference). @polinasok answers for your comment:
I fully agree with @roblourens: |
Pushed another change so that the behavior should align with the chart above. |
Just tried this with 1.67.0-insider: With launch request and
This is working as expected.
|
Andre listed both actions in the dropdown but I said that I wouldn't duplicate the top-level button's action in the dropdown.
Thanks for checking, I accidentally left Disconnect and Suspend out of the attach event. |
And the keyboard shortcut thing is just a limitation of how we look up keybindings - they do have the same shortcut, just in different contexts. Will see if I can clean it up. |
And also fix the stop alt action precondition
Thanks for the quick response, let me know when I can give this another try. |
The changes will be in Monday's insiders |
Tried with new insiders. I am glad there is a working solution. Thank you. Some additional usability thoughts below. With launch request and
|
And also fix the stop alt action precondition
Thanks for the feedback, you make good points
If I could have icons in the context menu, then I might like to duplicate the Disconnect action into the dropdown, like you suggest. I can't do that, and without that, I'm worried that it would make it more confusing, since the user might think there is a difference between the icon button and the Disconnect label command. Having the same icon would tie it together. I think I will wait for user feedback before trying anything else, let's see whether people are confused. |
microsoft/debug-adapter-protocol/issues/177 added
suspendDebuggee
to the protocol, but as far as I can tell it is not supported by the vscode UI. I can toggle to enable/disabledterminateDebuggee
only.The text was updated successfully, but these errors were encountered: