Remove the SuggestionMap

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
This commit is contained in:
Kirill Bulatov
2023-06-29 22:25:49 +03:00
co-authored by Antonio Scandurra
parent 8cdf1a0faf
commit d2fef07782
6 changed files with 201 additions and 308 deletions
+19 -1
View File
@@ -11,7 +11,7 @@ use std::{
any::TypeId,
cmp::{self, Ordering},
iter::{self, Peekable},
ops::{Range, Sub},
ops::{Add, AddAssign, Range, Sub},
sync::atomic::{AtomicUsize, Ordering::SeqCst},
vec,
};
@@ -508,6 +508,10 @@ impl FoldSnapshot {
self.folds.items(&self.buffer_snapshot).len()
}
pub fn text_summary(&self) -> TextSummary {
self.transforms.summary().output.clone()
}
pub fn text_summary_for_range(&self, range: Range<FoldPoint>) -> TextSummary {
let mut summary = TextSummary::default();
@@ -1170,6 +1174,20 @@ impl FoldOffset {
}
}
impl Add for FoldOffset {
type Output = Self;
fn add(self, rhs: Self) -> Self::Output {
Self(self.0 + rhs.0)
}
}
impl AddAssign for FoldOffset {
fn add_assign(&mut self, rhs: Self) {
self.0 += rhs.0;
}
}
impl Sub for FoldOffset {
type Output = Self;