diff --git a/crates/editor/src/display_map.rs b/crates/editor/src/display_map.rs index 88cdd9ac3668c43b1ebc34ed45f40440d96f27c1..20e2a2a266feabba8aae590740e15b66add5f102 100644 --- a/crates/editor/src/display_map.rs +++ b/crates/editor/src/display_map.rs @@ -308,9 +308,6 @@ impl DisplayMap { pub struct Highlights<'a> { pub text_highlights: Option<&'a TextHighlights>, pub inlay_highlights: Option<&'a InlayHighlights>, - // TODO kb remove, backgrounds are not handled in the *Map codegi - pub inlay_background_highlights: - Option, Arc<(HighlightStyle, &'a [InlayHighlight])>>>, pub inlay_highlight_style: Option, pub suggestion_highlight_style: Option, } @@ -482,9 +479,6 @@ impl DisplaySnapshot { &'a self, display_rows: Range, language_aware: bool, - inlay_background_highlights: Option< - TreeMap, Arc<(HighlightStyle, &'a [InlayHighlight])>>, - >, inlay_highlight_style: Option, suggestion_highlight_style: Option, ) -> DisplayChunks<'_> { @@ -494,7 +488,6 @@ impl DisplaySnapshot { Highlights { text_highlights: Some(&self.text_highlights), inlay_highlights: Some(&self.inlay_highlights), - inlay_background_highlights, inlay_highlight_style, suggestion_highlight_style, }, @@ -1714,7 +1707,7 @@ pub mod tests { ) -> Vec<(String, Option, Option)> { let snapshot = map.update(cx, |map, cx| map.snapshot(cx)); let mut chunks: Vec<(String, Option, Option)> = Vec::new(); - for chunk in snapshot.chunks(rows, true, None, None, None) { + for chunk in snapshot.chunks(rows, true, None, None) { let syntax_color = chunk .syntax_highlight_id .and_then(|id| id.style(theme)?.color); diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 67560b1b033eaacf7c60324439fb551a6244f855..e61a41f3efaa26d94a957629f3b5e9d82aa15499 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -7823,6 +7823,7 @@ impl Editor { color_fetcher: fn(&Theme) -> Color, cx: &mut ViewContext, ) { + // TODO: no actual highlights happen for inlays currently, find a way to do that self.inlay_background_highlights .insert(Some(TypeId::of::()), (color_fetcher, ranges)); cx.notify(); diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index bc3ca9f7b13593f909c751ac12cc6df965a06fbc..b7e34fda5377d6370d33cdec35087a4e544cd7d9 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -54,7 +54,6 @@ use std::{ ops::Range, sync::Arc, }; -use sum_tree::TreeMap; use text::Point; use workspace::item::Item; @@ -1548,7 +1547,6 @@ impl EditorElement { &mut self, rows: Range, line_number_layouts: &[Option], - editor: &mut Editor, snapshot: &EditorSnapshot, cx: &ViewContext, ) -> Vec { @@ -1593,28 +1591,10 @@ impl EditorElement { .collect() } else { let style = &self.style; - let theme = theme::current(cx); - let inlay_background_highlights = - TreeMap::from_ordered_entries(editor.inlay_background_highlights.iter().map( - |(type_id, (color_fetcher, ranges))| { - let color = Some(color_fetcher(&theme)); - ( - *type_id, - Arc::new(( - HighlightStyle { - color, - ..HighlightStyle::default() - }, - ranges.as_slice(), - )), - ) - }, - )); let chunks = snapshot .chunks( rows.clone(), true, - Some(inlay_background_highlights), Some(style.theme.hint), Some(style.theme.suggestion), ) @@ -2375,13 +2355,8 @@ impl Element for EditorElement { let scrollbar_row_range = scroll_position.y()..(scroll_position.y() + height_in_lines); let mut max_visible_line_width = 0.0; - let line_layouts = self.layout_lines( - start_row..end_row, - &line_number_layouts, - editor, - &snapshot, - cx, - ); + let line_layouts = + self.layout_lines(start_row..end_row, &line_number_layouts, &snapshot, cx); for line_with_invisibles in &line_layouts { if line_with_invisibles.line.width() > max_visible_line_width { max_visible_line_width = line_with_invisibles.line.width(); diff --git a/crates/editor/src/inlay_hint_cache.rs b/crates/editor/src/inlay_hint_cache.rs index 34898aea2efe7ec45229cdb4e63de13cd48217f9..9f9491d3de85b179e1da9c02cadfa112a134ce4e 100644 --- a/crates/editor/src/inlay_hint_cache.rs +++ b/crates/editor/src/inlay_hint_cache.rs @@ -485,6 +485,7 @@ impl InlayHintCache { self.hints.clear(); } + // TODO kb have a map pub fn hint_by_id(&self, excerpt_id: ExcerptId, hint_id: InlayId) -> Option { self.hints .get(&excerpt_id)? diff --git a/crates/editor/src/link_go_to_definition.rs b/crates/editor/src/link_go_to_definition.rs index 3de6fb872e5583f3d51f96c43df6bf47b2c8dc49..8786fc8086c018782075716482e58c5dd80c2f46 100644 --- a/crates/editor/src/link_go_to_definition.rs +++ b/crates/editor/src/link_go_to_definition.rs @@ -224,7 +224,6 @@ pub fn update_inlay_link_and_hover_points( extra_shift_left += 1; extra_shift_right += 1; } - // TODO kb is it right for label part cases? for `\n` in hints and fold cases? if cached_hint.padding_right { extra_shift_right += 1; }