mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-02 15:00:23 +00:00
Report the edits per transform summary generated
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
This commit is contained in:
parent
2ba3262f29
commit
4d76162da8
1 changed files with 21 additions and 5 deletions
|
@ -297,12 +297,12 @@ impl InlayMap {
|
||||||
transform_end += cursor.end(&()) - suggestion_edit.old.end;
|
transform_end += cursor.end(&()) - suggestion_edit.old.end;
|
||||||
cursor.next(&());
|
cursor.next(&());
|
||||||
}
|
}
|
||||||
new_transforms.push(
|
push_isomorphic(
|
||||||
Transform::Isomorphic(suggestion_snapshot.text_summary_for_range(
|
&mut new_transforms,
|
||||||
|
suggestion_snapshot.text_summary_for_range(
|
||||||
suggestion_snapshot.to_point(transform_start)
|
suggestion_snapshot.to_point(transform_start)
|
||||||
..suggestion_snapshot.to_point(transform_end),
|
..suggestion_snapshot.to_point(transform_end),
|
||||||
)),
|
),
|
||||||
&(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,7 +549,7 @@ impl InlaySnapshot {
|
||||||
|
|
||||||
match bias {
|
match bias {
|
||||||
Bias::Left => cursor.end(&()),
|
Bias::Left => cursor.end(&()),
|
||||||
Bias::Right => cursor.start(),
|
Bias::Right => *cursor.start(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -664,6 +664,22 @@ impl InlaySnapshot {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn push_isomorphic(sum_tree: &mut SumTree<Transform>, summary: TextSummary) {
|
||||||
|
let mut summary = Some(summary);
|
||||||
|
sum_tree.update_last(
|
||||||
|
|transform| {
|
||||||
|
if let Transform::Isomorphic(transform) = transform {
|
||||||
|
*transform += summary.take().unwrap();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
&(),
|
||||||
|
);
|
||||||
|
|
||||||
|
if let Some(summary) = summary {
|
||||||
|
sum_tree.push(Transform::Isomorphic(summary), &());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
Loading…
Reference in a new issue