Empty both hint cache storages correctly
This commit is contained in:
parent
e7b5880af0
commit
8c1df5afa2
1 changed files with 5 additions and 6 deletions
|
@ -986,10 +986,7 @@ fn calculate_hint_updates(
|
||||||
match cached_excerpt_hints
|
match cached_excerpt_hints
|
||||||
.ordered_hints
|
.ordered_hints
|
||||||
.binary_search_by(|probe| {
|
.binary_search_by(|probe| {
|
||||||
cached_excerpt_hints
|
cached_excerpt_hints.hints_by_id[probe]
|
||||||
.hints_by_id
|
|
||||||
.get(probe)
|
|
||||||
.unwrap()
|
|
||||||
.position
|
.position
|
||||||
.cmp(&new_hint.position, buffer_snapshot)
|
.cmp(&new_hint.position, buffer_snapshot)
|
||||||
}) {
|
}) {
|
||||||
|
@ -1101,6 +1098,9 @@ fn apply_hint_update(
|
||||||
cached_excerpt_hints
|
cached_excerpt_hints
|
||||||
.ordered_hints
|
.ordered_hints
|
||||||
.retain(|hint_id| !new_update.remove_from_cache.contains(hint_id));
|
.retain(|hint_id| !new_update.remove_from_cache.contains(hint_id));
|
||||||
|
cached_excerpt_hints
|
||||||
|
.hints_by_id
|
||||||
|
.retain(|hint_id, _| !new_update.remove_from_cache.contains(hint_id));
|
||||||
let mut splice = InlaySplice {
|
let mut splice = InlaySplice {
|
||||||
to_remove: new_update.remove_from_visible,
|
to_remove: new_update.remove_from_visible,
|
||||||
to_insert: Vec::new(),
|
to_insert: Vec::new(),
|
||||||
|
@ -3327,8 +3327,7 @@ all hints should be invalidated and requeried for all of its visible excerpts"
|
||||||
for (_, excerpt_hints) in &editor.inlay_hint_cache().hints {
|
for (_, excerpt_hints) in &editor.inlay_hint_cache().hints {
|
||||||
let excerpt_hints = excerpt_hints.read();
|
let excerpt_hints = excerpt_hints.read();
|
||||||
for id in &excerpt_hints.ordered_hints {
|
for id in &excerpt_hints.ordered_hints {
|
||||||
let inlay = excerpt_hints.hints_by_id.get(id).unwrap();
|
labels.push(excerpt_hints.hints_by_id[id].text());
|
||||||
labels.push(inlay.text());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue