Split diagnostics markdown style out (#29637)
Closes #29572 Release Notes: - Fixed paragraph spacing in git commit messages
This commit is contained in:
parent
c8685dc90f
commit
747a029487
3 changed files with 66 additions and 14 deletions
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue