From a42915b2d81d028b7b1faddcc5233bbefc55c25d Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:54:51 +0000 Subject: [PATCH] Fix panic in inlay hints (#49994) (cherry-pick to preview) (#50016) Cherry-pick of #49994 to preview ---- 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 Co-authored-by: Conrad Irwin 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 bcbf7d99b8da56587b20ad4b738e183dbfb5dc70..5f9dbffe4cf6c994dcf0f0e70ff8bdc3f935cf11 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)