clear focused thread if it does not exist#133637
Conversation
|
Thanks for the PR! Will have to look at it for October |
|
So the thread exited via a ThreadEvent? It seems like this should be changed at the moment the thread exits, rather than waiting until another thread stops, does that make sense? |
|
In this case there is no exited event for the thread that was selected. But the future threads request, does not include the thread. I can definitely add a clearing check when the thread exits, but this check later is still important to handle debug adapters that are not as thorough about sending thread events. For Go, we use the threads view to present goroutines and would not want to send threads events for every goroutine that is created, since there may be many short lived goroutines. We do not even track the creation / exit of new goroutines, but will look for them when the threads request is sent. We are also hoping that #116109 will yield some UI improvements. |
|
Ok thanks for the explanation. I am guessing that you set the Would it make sense to do fix in that function instead? So the condition would be |
|
Bump. we need this! |
I moved the logic to also check the condition here. But this also needs to be cleared in the case that there is no thread id returned in the stopped event (the thread id is optional so this case should be handled). |

When working with multithreaded programs, threads that are focused may not exist at the next stop. Make sure that the focus is not on a non-existent thread, since this will cause the toolbar to fail to update appropriately.
This PR fixes #133623