From 31db24b689b80a250abcc21eca50a493c27577fd Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Fri, 17 Oct 2025 10:14:20 +0800 Subject: [PATCH] editor: Improve hover popover delay. (#1389) --- crates/ui/src/input/lsp/hover.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/ui/src/input/lsp/hover.rs b/crates/ui/src/input/lsp/hover.rs index a369fe43..04f63cef 100644 --- a/crates/ui/src/input/lsp/hover.rs +++ b/crates/ui/src/input/lsp/hover.rs @@ -48,10 +48,14 @@ impl InputState { let task = provider.hover(&self.text, offset, window, cx); let mut symbol_range = self.text.word_range(offset).unwrap_or(offset..offset); let editor = cx.entity(); + let should_delay = self.hover_popover.is_none(); self.lsp._hover_task = cx.spawn_in(window, async move |_, cx| { - cx.background_executor() - .timer(Duration::from_millis(150)) - .await; + if should_delay { + cx.background_executor() + .timer(Duration::from_millis(150)) + .await; + } + let result = task.await?; _ = editor.update(cx, |editor, cx| match result {