Renames: HighlightedText->HighlightedMatch + HighlightedEdits->HighlightedText (#24057)

In support of work on
https://github.com/zed-industries/zed/tree/new-ui-for-edit-prediction-with-lsp-completions,
where we want to be able to extract a range of the buffer as
`HighlightedText`.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-01-31 16:15:46 -07:00 committed by GitHub
parent 4d9659adc4
commit 93c7b54caa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 21 additions and 21 deletions

View file

@ -596,7 +596,7 @@ pub struct EditPreview {
}
#[derive(Default, Clone, Debug)]
pub struct HighlightedEdits {
pub struct HighlightedText {
pub text: SharedString,
pub highlights: Vec<(Range<usize>, HighlightStyle)>,
}
@ -608,9 +608,9 @@ impl EditPreview {
edits: &[(Range<Anchor>, String)],
include_deletions: bool,
cx: &App,
) -> HighlightedEdits {
) -> HighlightedText {
let Some(visible_range_in_preview_snapshot) = self.compute_visible_range(edits) else {
return HighlightedEdits::default();
return HighlightedText::default();
};
let mut text = String::new();
@ -686,7 +686,7 @@ impl EditPreview {
cx,
);
HighlightedEdits {
HighlightedText {
text: text.into(),
highlights,
}

View file

@ -2739,7 +2739,7 @@ async fn test_preview_edits(cx: &mut TestAppContext) {
edits: Vec<(Range<Point>, &str)>,
include_deletions: bool,
cx: &mut TestAppContext,
assert_fn: impl Fn(HighlightedEdits),
assert_fn: impl Fn(HighlightedText),
) {
let buffer = cx.new(|cx| Buffer::local(text, cx).with_language(Arc::new(rust_lang()), cx));
let edits = buffer.read_with(cx, |buffer, _| {