Split diagnostics markdown style out (#29637)

Closes #29572

Release Notes:

- Fixed paragraph spacing in git commit messages
This commit is contained in:
Conrad Irwin 2025-04-29 22:08:06 -06:00 committed by GitHub
parent c8685dc90f
commit 747a029487
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 66 additions and 14 deletions

View file

@ -3,7 +3,7 @@ use std::{ops::Range, sync::Arc};
use editor::{
Anchor, Editor, EditorSnapshot, ToOffset,
display_map::{BlockContext, BlockPlacement, BlockProperties, BlockStyle},
hover_markdown_style,
hover_popover::diagnostics_markdown_style,
scroll::Autoscroll,
};
use gpui::{AppContext, Entity, Focusable, WeakEntity};
@ -215,16 +215,19 @@ impl DiagnosticBlock {
.border_color(border_color)
.max_w(max_width)
.child(
MarkdownElement::new(self.markdown.clone(), hover_markdown_style(bcx.window, cx))
.on_url_click({
move |link, window, cx| {
editor
.update(cx, |editor, cx| {
Self::open_link(editor, &diagnostics_editor, link, window, cx)
})
.ok();
}
}),
MarkdownElement::new(
self.markdown.clone(),
diagnostics_markdown_style(bcx.window, cx),
)
.on_url_click({
move |link, window, cx| {
editor
.update(cx, |editor, cx| {
Self::open_link(editor, &diagnostics_editor, link, window, cx)
})
.ok();
}
}),
)
.into_any_element()
}

View file

@ -23,6 +23,7 @@ use language::{
Bias, Buffer, BufferRow, BufferSnapshot, DiagnosticEntry, Point, ToTreeSitterPoint,
};
use lsp::DiagnosticSeverity;
use project::{DiagnosticSummary, Project, ProjectPath, project_settings::ProjectSettings};
use settings::Settings;
use std::{
@ -521,7 +522,7 @@ impl ProjectDiagnosticsEditor {
markdown::MarkdownElement::rendered_text(
markdown.clone(),
cx,
editor::hover_markdown_style,
editor::hover_popover::diagnostics_markdown_style,
)
},
);