about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-25 15:01:08 +0000
committerbors <bors@rust-lang.org>2023-05-25 15:01:08 +0000
commit1c6561320ff70e62c12e3cc41391cb752c9259cb (patch)
tree673b8038134aecc3c05d7fdc1f717bec69364aa5
parent21e5dc2af986d2eccb9d7caa74455a48b26c7ae6 (diff)
parente3dfcf2eb2daabe777c7f320b37a4fe6c117d5b1 (diff)
downloadrust-1c6561320ff70e62c12e3cc41391cb752c9259cb.tar.gz
rust-1c6561320ff70e62c12e3cc41391cb752c9259cb.zip
Auto merge of #14889 - Veykril:overly-dbg, r=Veykril
Add context to overly long loop message
-rw-r--r--crates/rust-analyzer/src/main_loop.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index f06abe0763e..99aa48fd079 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -184,6 +184,7 @@ impl GlobalState {
         // NOTE: don't count blocking select! call as a loop-turn time
         let _p = profile::span("GlobalState::handle_event");
 
+        let event_dbg = format!("{event:?}");
         tracing::debug!("{:?} handle_event({:?})", loop_start, event);
         let task_queue_len = self.task_pool.handle.len();
         if task_queue_len > 0 {
@@ -394,8 +395,10 @@ impl GlobalState {
 
         let loop_duration = loop_start.elapsed();
         if loop_duration > Duration::from_millis(100) && was_quiescent {
-            tracing::warn!("overly long loop turn: {:?}", loop_duration);
-            self.poke_rust_analyzer_developer(format!("overly long loop turn: {loop_duration:?}"));
+            tracing::warn!("overly long loop turn took {loop_duration:?}: {event_dbg}");
+            self.poke_rust_analyzer_developer(format!(
+                "overly long loop turn took {loop_duration:?}: {event_dbg}"
+            ));
         }
         Ok(())
     }