-
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
Debugger: Add option to allow disconnect and stop/terminate UI elements #116731
Comments
This feature request asks for surfacing the optional
|
This makes sense. So for
I would start with these three. What I would not yet do:
Do we also want to do this for Let me know what you think. |
At least from a technical standpoint |
@isidorn The "launch" scenario is more important than "attach" because here debug adapters have a more realistic chance to actually being able control whether the debuggee is terminated or not. In the "attach" case it might be impossible for a debug adapter to terminate the debuggee because it does not have access to the process (because it did not launch the debuggee in the first place). Other than that I agree with your proposal from above. |
Thanks for feedback. So now we have a plan, I will do 1. 2. and 3. for both |
I have coded up what we have agreed upon. The following gif shows these in practice (in the last part I am holding down the |
Hello @isidorn ! I can't figure out what is different. When a connection is created we fire a ThreadEvent('started'). I tried a ProcessEvent, but that has no effect, not is it defined in the vscode-debugadapter. Any ideas what I'm doing wrong? Also, I was under the impression this would be controlled by the Also, I expected to see that the disconnectRequest args should be caring a Thanks! |
@zobo thanks a lot for trying this out.
|
Hi @isidorn, thanks for getting back!
From your commits I see that the UI controls whether What do you think? |
@isidorn please note that this new UI does not change whether a disconnect or a terminate request is issued. It only changes the value of the bool on the disconnect request and it is the responsability of the DA to do the right thing. If the DA doesn't respect the flag, there will be no change in behavior, The terminate request is completely unrelated to this feature. |
Thanks for correcting me, I was confusing things. If the adapter does not
|
@isidorn I believe your proposed behavior is correct, but not crystal clear to me. Today the UI shows "Stop" for "launch and "Disconnect" for "attach". With the new UI feature: If the DA has a falsy If the DA has a true
|
Great, we are on the same page. I will code this up now. |
This is perhaps a question for DAP project, but what is actually the difference between First has They at least seem redundant? |
No, if a DA opts into supporting a The The To learn how node-debug supports the |
I have pushed a fix for this as we have agreed upon. Also we show the alternative action in the debug toolbar on alt hover even if the debugger does not support |
Great, I'll test it as soon as it's in insiders build. Thank you! cc: I think @polinasok was also interested in this... |
@isidorn it it possible to disable the alt-actions? |
@weinand in theory disabling alt actions should be possible, and I tried just that however in practice it does not work. Since they look as enabled even though clicking on them has no effect. I looked a bit into this issue but could not figure out the exact cause of the problem in the menus. I can investigate more... |
I have tested the relevant scenarios for us and it works as expected! Thank you very much! |
Thanks a lot for trying it out, adding verified label per your comment. |
Thank you for working on this. I gave this a try as well with insiders. |
@isidorn I think the |
@polinasok thanks a lot for trying this out. However the problem might be coming from the fact that we also call If you can still see the terminateDebuggee flag missing let me know. |
If I may add. In normal usage I don't see this problem, however during tests I see that the It may be due to https://github.com/xdebug/vscode-php-debug/blob/feat/supportTerminateDebuggee/src/test/adapter.ts#L21 and in specific disconnect test this: https://github.com/xdebug/vscode-php-debug/blob/feat/supportTerminateDebuggee/src/test/adapter.ts#L74 In the second case I explicitly added a parameter object, where before there is none. I'm thinking about going in a different direction and just use |
We have this field marked as omitempy in our Go-to-json spec that we automatically generate from the dap schema. So when we receive a false (empty) value and then log it as json, it gets dropped. |
Currently VSCode will present only "stop" or "disconnect" button in a debug session, depending on "request" value in launch.json (launch or attach).
There a re cases where the user would like to choose for them selves if they need a STOP operation (terminating the execution of the debugee) or DISCONNECT (allowing the debugee to run free).
This would probably not require any changes to DAP. There is already a
supportTerminateDebuggee
flag that could be used to offer both options (disconnect / stop).Or at least add a vscode command and menu entry like in Visual Studios
Detach All
.Let me know if I can provide more context.
Thank you.
The text was updated successfully, but these errors were encountered: