Clean up stale conflicting hints

This commit is contained in:
Kirill Bulatov 2023-07-19 14:06:00 +03:00
parent 33921183dc
commit 3058a96dee
2 changed files with 323 additions and 61 deletions

View file

@ -2659,11 +2659,16 @@ impl Editor {
InlayRefreshReason::RefreshRequested => (InvalidationStrategy::RefreshRequested, None),
};
self.inlay_hint_cache.refresh_inlay_hints(
if let Some(InlaySplice {
to_remove,
to_insert,
}) = self.inlay_hint_cache.spawn_hint_refresh(
self.excerpt_visible_offsets(required_languages.as_ref(), cx),
invalidate_cache,
cx,
)
) {
self.splice_inlay_hints(to_remove, to_insert, cx);
}
}
fn visible_inlay_hints(&self, cx: &ViewContext<'_, '_, Editor>) -> Vec<Inlay> {