Compare commits

...

1 Commits

Author SHA1 Message Date
Michael Sloan
b34e4c3e72 Make editor::render_parsed_markdown not take EditorStyle 2025-01-16 03:23:34 -07:00
5 changed files with 11 additions and 6 deletions

View File

@@ -135,7 +135,8 @@ impl Render for BlameEntryTooltip {
crate::render_parsed_markdown(
"blame-message",
&details.parsed_message,
&self.editor_style,
&self.editor_style.syntax,
&self.editor_style.text,
self.workspace.clone(),
cx,
)

View File

@@ -632,7 +632,8 @@ impl CompletionsMenu {
.child(render_parsed_markdown(
"completions_markdown",
parsed,
&style,
&style.syntax,
&style.text,
workspace,
cx,
)),

View File

@@ -197,7 +197,8 @@ pub(crate) const SCROLL_CENTER_TOP_BOTTOM_DEBOUNCE_TIMEOUT: Duration = Duration:
pub fn render_parsed_markdown(
element_id: impl Into<ElementId>,
parsed: &language::ParsedMarkdown,
editor_style: &EditorStyle,
syntax_theme: &SyntaxTheme,
text_style: &TextStyle,
workspace: Option<WeakView<Workspace>>,
cx: &mut WindowContext,
) -> InteractiveText {
@@ -208,7 +209,7 @@ pub fn render_parsed_markdown(
let highlights = gpui::combine_highlights(
parsed.highlights.iter().filter_map(|(range, highlight)| {
let highlight = highlight.to_highlight_style(&editor_style.syntax)?;
let highlight = highlight.to_highlight_style(syntax_theme)?;
Some((range.clone(), highlight))
}),
parsed
@@ -241,7 +242,7 @@ pub fn render_parsed_markdown(
InteractiveText::new(
element_id,
StyledText::new(parsed.text.clone()).with_highlights(&editor_style.text, highlights),
StyledText::new(parsed.text.clone()).with_highlights(&text_style, highlights),
)
.on_click(link_ranges, move |clicked_range_ix, cx| {
match &links[clicked_range_ix] {

View File

@@ -39,7 +39,8 @@ impl SignatureHelpPopover {
.child(div().p_2().child(crate::render_parsed_markdown(
"signature_help_popover_content",
&self.parsed_content,
style,
&style.syntax,
&style.text,
workspace,
cx,
)))

View File

@@ -1,6 +1,7 @@
pub mod arc_cow;
pub mod command;
pub mod fs;
pub mod markdown;
pub mod paths;
pub mod serde;
#[cfg(any(test, feature = "test-support"))]