Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Properly invalidate the hint cache
Kirill Bulatov44c340b5f25d
diff --git a/crates/editor/src/inlay_hint_cache.rs b/crates/editor/src/inlay_hint_cache.rsindex 54ed8f8f118..b33b93a3487 100644--- a/crates/editor/src/inlay_hint_cache.rs+++ b/crates/editor/src/inlay_hint_cache.rs@@ -785,6 +785,7 @@ async fn fetch_and_update_hints(editor,new_update,query,+ invalidate,buffer_snapshot,multi_buffer_snapshot,cx,@@ -893,6 +894,7 @@ fn apply_hint_update(editor: &mut Editor,new_update: ExcerptHintsUpdate,query: ExcerptQuery,+ invalidate: bool,buffer_snapshot: BufferSnapshot,multi_buffer_snapshot: MultiBufferSnapshot,cx: &mut ViewContext<'_, '_, Editor>,@@ -970,7 +972,7 @@ fn apply_hint_update(cached_excerpt_hints.buffer_version = buffer_snapshot.version().clone();drop(cached_excerpt_hints);- if query.invalidate.should_invalidate() {+ if invalidate {let mut outdated_excerpt_caches = HashSet::default();for (excerpt_id, excerpt_hints) in &editor.inlay_hint_cache().hints {let excerpt_hints = excerpt_hints.read();