From 0f92e3d0b87cfb8601a6d885752f27fc4995505c 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:56:34 +0000 Subject: [PATCH] Return back the eager snapshot update (#45210) (cherry-pick to stable) (#45213) Cherry-pick of #45210 to stable ---- 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 1f0275248088ce4b8367cf6db7b241afc43a2dcf..728dfe9a3c0490e048cc8932a5d6a1f1ad4f8021 100644 --- a/crates/language/src/buffer.rs +++ b/crates/language/src/buffer.rs @@ -1670,6 +1670,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; }