-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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] Add the possibility to know when the debug widget has been cleared #8639
Comments
@federicobozzini would it not be easiest to rely and listen to the debug events?
theia/packages/debug/src/browser/debug-session-manager.ts Lines 48 to 51 in c4f324a
I'm not sure what problem is solved by knowing when the debug-widget is cleared, or has no debug sessions that the service would not tell you. |
Let's say that you want to change the active panel when the debug session is terminated. Of course you could use the events you just linked. The problem is that the debug information shown during the debug session (threads, breakpoints, watched variables, ...) is not cleared if the debug widget is not visible because the active panel replaces it too soon. Those events are fired before the debug information is cleared and this generates a race condition. |
If I understand correctly, the issue is that you want to change the active panel when a debug session is terminated, but this results in a race condition since you rely on the widget and not the debug events to determine when to switch panels? If its the case I'd argue not to rely on the debug-widget clearing but the actual debug session events I mentioned earlier. Else, I'd argue that the Of course I might be misunderstanding the use-case completely. |
No this is not correct, sorry for the confusion. The race condition is exactly what I get if I try to use the debug events to switch the active panel. This happens because, in this case, both the active panel switch and the clearing of the debug widget happen as a result of the debug event getting fired. If the panel is switched before the debug widget is cleared, the clearing doesn't happen at all, because the debug widget needs to be visible. Given that, I think the two possible ways to avoid this situation is either to switch the active panel after the debug widget is cleared or just allow the debug widget to refresh when it's not visible. I'm not sure if |
Thank you for clarifying! |
Feature Description:
When a debug session is terminated, the debug widget is cleared.
This operation requires the debug widget to be visible. This means that at the moment it's not possible to perform some operations (like switching to a different panel) when a debug session is terminated without generating a race condition.
It would be helpful to have some way to update the debug widget to clear even when not visible or fire an event when the clearing is completed.
There are different ways to tackle this. To me it looks like the simplest way would be to add a property (false by default) on
TreeWidget
to make it always updatable. What do you think?The text was updated successfully, but these errors were encountered: