language: Make TreeSitterData only shared between snapshots of the same version (#44198)
Currently we have a single cache for this data shared between all snapshots which is incorrect, as we might update the cache to a new version while having old snapshots around which then may try to access new data with old offsets/rows. Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -2321,8 +2321,13 @@ impl BufferSnapshot {
|
||||
} else if anchor.is_max() {
|
||||
self.visible_text.len()
|
||||
} else {
|
||||
debug_assert!(anchor.buffer_id == Some(self.remote_id));
|
||||
debug_assert!(self.version.observed(anchor.timestamp));
|
||||
debug_assert_eq!(anchor.buffer_id, Some(self.remote_id));
|
||||
debug_assert!(
|
||||
self.version.observed(anchor.timestamp),
|
||||
"Anchor timestamp {:?} not observed by buffer {:?}",
|
||||
anchor.timestamp,
|
||||
self.version
|
||||
);
|
||||
let anchor_key = InsertionFragmentKey {
|
||||
timestamp: anchor.timestamp,
|
||||
split_offset: anchor.offset,
|
||||
|
||||
Reference in New Issue
Block a user