Skip to content

Commit 1c65613

Browse files
committed
Auto merge of rust-lang#14889 - Veykril:overly-dbg, r=Veykril
Add context to overly long loop message
2 parents 21e5dc2 + e3dfcf2 commit 1c65613

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/rust-analyzer/src/main_loop.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ impl GlobalState {
184184
// NOTE: don't count blocking select! call as a loop-turn time
185185
let _p = profile::span("GlobalState::handle_event");
186186

187+
let event_dbg = format!("{event:?}");
187188
tracing::debug!("{:?} handle_event({:?})", loop_start, event);
188189
let task_queue_len = self.task_pool.handle.len();
189190
if task_queue_len > 0 {
@@ -394,8 +395,10 @@ impl GlobalState {
394395

395396
let loop_duration = loop_start.elapsed();
396397
if loop_duration > Duration::from_millis(100) && was_quiescent {
397-
tracing::warn!("overly long loop turn: {:?}", loop_duration);
398-
self.poke_rust_analyzer_developer(format!("overly long loop turn: {loop_duration:?}"));
398+
tracing::warn!("overly long loop turn took {loop_duration:?}: {event_dbg}");
399+
self.poke_rust_analyzer_developer(format!(
400+
"overly long loop turn took {loop_duration:?}: {event_dbg}"
401+
));
399402
}
400403
Ok(())
401404
}

0 commit comments

Comments
 (0)