Fix more panics when removing excerpts (#28836)
Release Notes: - Fixed a panic when an excerpt removed has an edit suggestion inlay in it --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
0d8f77b5de
commit
486a9e4d61
5 changed files with 26 additions and 8 deletions
|
@ -555,12 +555,12 @@ impl InlayHintCache {
|
|||
/// Completely forget of certain excerpts that were removed from the multibuffer.
|
||||
pub(super) fn remove_excerpts(
|
||||
&mut self,
|
||||
excerpts_removed: Vec<ExcerptId>,
|
||||
excerpts_removed: &[ExcerptId],
|
||||
) -> Option<InlaySplice> {
|
||||
let mut to_remove = Vec::new();
|
||||
for excerpt_to_remove in excerpts_removed {
|
||||
self.update_tasks.remove(&excerpt_to_remove);
|
||||
if let Some(cached_hints) = self.hints.remove(&excerpt_to_remove) {
|
||||
self.update_tasks.remove(excerpt_to_remove);
|
||||
if let Some(cached_hints) = self.hints.remove(excerpt_to_remove) {
|
||||
let cached_hints = cached_hints.read();
|
||||
to_remove.extend(cached_hints.ordered_hints.iter().copied());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue