WIP and merge

This commit is contained in:
Anthony 2025-06-27 18:38:25 -04:00
parent 97f4406ef6
commit 1bdde8b2e4
584 changed files with 33536 additions and 17400 deletions

View file

@ -32,6 +32,7 @@ pub struct SyntaxSnapshot {
parsed_version: clock::Global,
interpolated_version: clock::Global,
language_registry_version: usize,
update_count: usize,
}
#[derive(Default)]
@ -257,7 +258,9 @@ impl SyntaxMap {
}
pub fn clear(&mut self, text: &BufferSnapshot) {
let update_count = self.snapshot.update_count + 1;
self.snapshot = SyntaxSnapshot::new(text);
self.snapshot.update_count = update_count;
}
}
@ -268,6 +271,7 @@ impl SyntaxSnapshot {
parsed_version: clock::Global::default(),
interpolated_version: clock::Global::default(),
language_registry_version: 0,
update_count: 0,
}
}
@ -275,6 +279,10 @@ impl SyntaxSnapshot {
self.layers.is_empty()
}
pub fn update_count(&self) -> usize {
self.update_count
}
pub fn interpolate(&mut self, text: &BufferSnapshot) {
let edits = text
.anchored_edits_since::<(usize, Point)>(&self.interpolated_version)
@ -443,6 +451,8 @@ impl SyntaxSnapshot {
self.language_registry_version = registry.version();
}
}
self.update_count += 1;
}
fn reparse_with_ranges(