From 42571e405faa3db4e52a23407b33b3beac358d20 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sat, 1 Mar 2025 10:15:57 +0200 Subject: [PATCH] Ensure inlay hint toggling with modifiers happens fast (#25852) Follow-up of https://github.com/zed-industries/zed/pull/25766 Fixes the bugs found: * modifier toggle not happening instantly due to `edit_debounce_ms` considered * hint update race that ignored the cache clear Release Notes: - N/A --- crates/editor/src/editor.rs | 1 + crates/editor/src/inlay_hint_cache.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 811e1d5f0b..42fb328b43 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -3691,6 +3691,7 @@ impl Editor { InlayHintRefreshReason::SettingsChange(_) | InlayHintRefreshReason::Toggle(_) | InlayHintRefreshReason::ExcerptsRemoved(_) + | InlayHintRefreshReason::ModifiersChanged(_) ); let (invalidate_cache, required_languages) = match reason { InlayHintRefreshReason::ModifiersChanged(enabled) => { diff --git a/crates/editor/src/inlay_hint_cache.rs b/crates/editor/src/inlay_hint_cache.rs index 83a806455f..cc0511d3a9 100644 --- a/crates/editor/src/inlay_hint_cache.rs +++ b/crates/editor/src/inlay_hint_cache.rs @@ -581,6 +581,7 @@ impl InlayHintCache { self.version += 1; } self.update_tasks.clear(); + self.refresh_task = Task::ready(()); self.hints.clear(); }