From cbb9cce38dd6ff1dedca84794ed20d6d3405f4a6 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 24 Feb 2026 11:44:56 -0700 Subject: [PATCH] Fix panic in inlay hints (#49994) We were resolving inlay hints against an old snapshot, which occasionally led to panics Co-Authored-By: Cole Closes #ISSUE Before you mark this PR as ready for review, make sure that you have: - [ ] Added a solid test coverage and/or screenshots from doing manual testing - [ ] Done a self-review taking into account security and performance aspects - [ ] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - Fixed a (rare) panic in inlay hints Co-authored-by: Cole --- crates/editor/src/inlays/inlay_hints.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/editor/src/inlays/inlay_hints.rs b/crates/editor/src/inlays/inlay_hints.rs index 72951834ff4794b8862f9254af77bd9c997fb1a1..19953659ac67db14c59513cea27090de669f0166 100644 --- a/crates/editor/src/inlays/inlay_hints.rs +++ b/crates/editor/src/inlays/inlay_hints.rs @@ -578,6 +578,7 @@ impl Editor { if let Some(hovered_hint) = self .visible_inlay_hints(cx) .into_iter() + .filter(|hint| snapshot.can_resolve(&hint.position)) .skip_while(|hint| { hint.position .cmp(&previous_valid_anchor, &buffer_snapshot)