debugger: Parse and highlight text with ANSI escape sequences (#32915)

Relanding #32817 with an improved approach, bugs fixed, and a test.

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-06-17 23:39:31 -04:00 committed by GitHub
parent 4da58188fb
commit bfffc293a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 606 additions and 80 deletions

View file

@ -12,8 +12,8 @@ use crate::{
ToggleFold,
code_context_menus::{CodeActionsMenu, MENU_ASIDE_MAX_WIDTH, MENU_ASIDE_MIN_WIDTH, MENU_GAP},
display_map::{
Block, BlockContext, BlockStyle, DisplaySnapshot, EditorMargins, FoldId, HighlightedChunk,
ToDisplayPoint,
Block, BlockContext, BlockStyle, DisplaySnapshot, EditorMargins, FoldId, HighlightKey,
HighlightedChunk, ToDisplayPoint,
},
editor_settings::{
CurrentLineHighlight, DocumentColorsRenderMode, DoubleClickInMultibuffer, MinimapThumb,
@ -6166,13 +6166,15 @@ impl EditorElement {
background_highlights.iter()
{
let is_search_highlights = *background_highlight_id
== TypeId::of::<BufferSearchHighlights>();
== HighlightKey::Type(TypeId::of::<BufferSearchHighlights>());
let is_text_highlights = *background_highlight_id
== TypeId::of::<SelectedTextHighlight>();
== HighlightKey::Type(TypeId::of::<SelectedTextHighlight>());
let is_symbol_occurrences = *background_highlight_id
== TypeId::of::<DocumentHighlightRead>()
== HighlightKey::Type(TypeId::of::<DocumentHighlightRead>())
|| *background_highlight_id
== TypeId::of::<DocumentHighlightWrite>();
== HighlightKey::Type(
TypeId::of::<DocumentHighlightWrite>(),
);
if (is_search_highlights && scrollbar_settings.search_results)
|| (is_text_highlights && scrollbar_settings.selected_text)
|| (is_symbol_occurrences && scrollbar_settings.selected_symbol)
@ -8091,7 +8093,7 @@ impl Element for EditorElement {
editor.read(cx).background_highlights_in_range(
start_anchor..end_anchor,
&snapshot.display_snapshot,
cx.theme().colors(),
cx.theme(),
)
})
.unwrap_or_default();