From adaa21da07e6a7d31470ae9639951e63bb0e81fc Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 09:57:12 +0000 Subject: [PATCH] Return back the eager snapshot update (#45210) (cherry-pick to preview) (#45212) Cherry-pick of #45210 to preview ---- Based on https://github.com/zed-industries/zed/pull/45187#discussion_r2630140112 Release Notes: - N/A Co-authored-by: Lukas Wirth Co-authored-by: Kirill Bulatov Co-authored-by: Lukas Wirth --- crates/language/src/buffer.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/language/src/buffer.rs b/crates/language/src/buffer.rs index 7007d01458b60fb019084cadbfb18463dc2f6ceb..4e20e22b0a7d3ef0768826f693bc9f17190a770a 100644 --- a/crates/language/src/buffer.rs +++ b/crates/language/src/buffer.rs @@ -1672,6 +1672,9 @@ impl Buffer { /// for the same buffer, we only initiate a new parse if we are not already /// parsing in the background. pub fn reparse(&mut self, cx: &mut Context, may_block: bool) { + if self.text.version() != *self.tree_sitter_data.version() { + self.invalidate_tree_sitter_data(self.text.snapshot()); + } if self.reparse.is_some() { return; }