Pass inlay highlight information
This commit is contained in:
parent
477fc865f5
commit
6c5761d05b
9 changed files with 279 additions and 145 deletions
|
@ -1,7 +1,7 @@
|
|||
use super::{
|
||||
fold_map::FoldBufferRows,
|
||||
tab_map::{self, TabEdit, TabPoint, TabSnapshot},
|
||||
TextHighlights,
|
||||
InlayHighlights, TextHighlights,
|
||||
};
|
||||
use crate::MultiBufferSnapshot;
|
||||
use gpui::{
|
||||
|
@ -447,6 +447,7 @@ impl WrapSnapshot {
|
|||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
let mut edit_transforms = Vec::<Transform>::new();
|
||||
for _ in edit.new_rows.start..edit.new_rows.end {
|
||||
|
@ -576,8 +577,9 @@ impl WrapSnapshot {
|
|||
rows: Range<u32>,
|
||||
language_aware: bool,
|
||||
text_highlights: Option<&'a TextHighlights>,
|
||||
hint_highlights: Option<HighlightStyle>,
|
||||
suggestion_highlights: Option<HighlightStyle>,
|
||||
inlay_highlights: Option<&'a InlayHighlights>,
|
||||
inlay_highlight_style: Option<HighlightStyle>,
|
||||
suggestion_highlight_style: Option<HighlightStyle>,
|
||||
) -> WrapChunks<'a> {
|
||||
let output_start = WrapPoint::new(rows.start, 0);
|
||||
let output_end = WrapPoint::new(rows.end, 0);
|
||||
|
@ -595,8 +597,9 @@ impl WrapSnapshot {
|
|||
input_start..input_end,
|
||||
language_aware,
|
||||
text_highlights,
|
||||
hint_highlights,
|
||||
suggestion_highlights,
|
||||
inlay_highlights,
|
||||
inlay_highlight_style,
|
||||
suggestion_highlight_style,
|
||||
),
|
||||
input_chunk: Default::default(),
|
||||
output_position: output_start,
|
||||
|
@ -1326,6 +1329,7 @@ mod tests {
|
|||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
)
|
||||
.map(|h| h.text)
|
||||
}
|
||||
|
@ -1350,7 +1354,7 @@ mod tests {
|
|||
}
|
||||
|
||||
let actual_text = self
|
||||
.chunks(start_row..end_row, true, None, None, None)
|
||||
.chunks(start_row..end_row, true, None, None, None, None)
|
||||
.map(|c| c.text)
|
||||
.collect::<String>();
|
||||
assert_eq!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue