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
Respect the CancelationToken in provideDebugConfigurations and resolveDebugConfigurations to cancel debugging #77293
Comments
Well the stop sent a @ivanhernandez13 are you an extension writer. Do you see some idfferent behavior than what I just mentioned? And sorry for the slow reponse, I was on vacation. |
No worries, thanks for the response. I am working on a debug extension that uses an executable for the debug adapter. The series of events you describe are accurate but only occur after the debug adapter has started and that only occurs after
So if the user happens to click stop between steps 2-5, there is no way to detect a I mentioned I tried the cancellation token's |
Ok, thanks for providing more details. In order to reproduce this situation I have changed the If you would like me to investigate more, please create a fork of mock-debug with the changes such that I can just clone it and reproduce the issue on my machine such that the |
https://github.com/ivanhernandez13/vscode-mock-debug.git This will wait 5 seconds before resolving the debug configuration in |
@ivanhernandez13 Great steps. I can now reproduce the issue nicely and I acknowledge what you were saying: that the debug adapter is not yet spawned, thus it is not possible to send a |
@isidorn the two |
@weinand thanks. |
I built VS Code from head to try this out and works great, thanks! |
@ivanhernandez13 thanks for letting us know! |
Steps to Reproduce:
resolveDebugConfiguration()
in extension.ts.for (let i = 0; i < 10000; i++) { console.log(i) }
The debug toolbar will hide but won't do anything. The debug adapter will still launch and the debug session will begin and thus the toolbar will reappear.
Video: https://1drv.ms/v/s!AiguEN65RhivhFQM-7S7ayzDQ3l6
Note in the video that clicking on stop before the debug adapter has launched won't trigger
vscode.debug.onDidTerminateDebugSession()
to be called. Is there a way to detect that the user has tried to stop the debug session after they have clicked to start the debug session but before the debug adapter has launched e.g. in the middle ofresolveDebugConfiguration()
?resolveDebugConfiguration()
takes aCancellationToken
but adding an event handler toonCancellationRequested()
doesn't seem to be called and checkingisCancellationRequested
at the end ofresolveDebugConfiguration()
is still false.Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: