debugger: Do not query threads when session is still building (#32852)

This should silence a noisy log we see whenever a debug session is
started:
`2025-06-17T12:06:12+02:00 ERROR [project] no adapter running to send
request: ThreadsCommand`

Closes #ISSUE

Release Notes:

- Fixed debugger logs getting clobbered with internal logs about Threads
Command whenever a new debug session is created.
This commit is contained in:
Piotr Osiewicz 2025-06-17 12:36:46 +02:00 committed by GitHub
parent 4b88090cca
commit d4c9522da7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -858,16 +858,21 @@ impl DebugPanel {
let threads = let threads =
running_state.update(cx, |running_state, cx| { running_state.update(cx, |running_state, cx| {
let session = running_state.session(); let session = running_state.session();
session session.read(cx).is_running().then(|| {
.update(cx, |session, cx| session.threads(cx)) session.update(cx, |session, cx| {
session.threads(cx)
})
})
}); });
self.render_thread_dropdown( threads.and_then(|threads| {
&running_state, self.render_thread_dropdown(
threads, &running_state,
window, threads,
cx, window,
) cx,
)
})
}) })
.when(!is_side, |this| this.gap_2().child(Divider::vertical())) .when(!is_side, |this| this.gap_2().child(Divider::vertical()))
}, },