mod code_action_menu; mod completion_menu; mod diagnostic_popover; mod hover_popover; pub(crate) use code_action_menu::*; pub(crate) use completion_menu::*; pub(crate) use diagnostic_popover::*; pub(crate) use hover_popover::*; use gpui::{ App, Div, ElementId, InteractiveElement as _, SharedString, Stateful, StyleRefinement, Styled as _, Window, div, px, rems, }; use crate::{ ActiveTheme, ThemeStyled as _, text::{TextView, TextViewStyle}, }; pub(super) fn render_markdown( id: impl Into, markdown: impl Into, _: &mut Window, cx: &mut App, ) -> TextView { TextView::markdown(id, markdown) .style( TextViewStyle::default() .paragraph_gap(rems(0.5)) .heading_font_size(|level, rem_size| match level { 1..=3 => rem_size * 1, 4 => rem_size * 0.9, _ => rem_size * 0.8, }) .code_block( StyleRefinement::default() .bg(cx.theme().transparent) .p_0() .text_size(px(11.)), ), ) .selectable(true) } pub(super) fn editor_popover(id: impl Into, window: &Window, cx: &App) -> Stateful
{ div() .id(id) .flex_none() .occlude() .popover_style(window, cx) .text_xs() .p_1() }