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:
parent
4d9659adc4
commit
93c7b54caa
7 changed files with 21 additions and 21 deletions
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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, _| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue