State and rendering for LSP hover tooltips.
Parses LSP hover markdown content into styled display list draws and renders them in a cursor-anchored floating window. Supports scrolling for long content (j/k when focused) and the LazyVim pattern of pressing K once to show, K again to focus into the hover for scrolling.
Lifecycle
Summary
Functions
Focus into the hover popup for scrolling.
Creates a new hover popup from LSP hover content.
Renders the hover popup as a list of display list draws.
Scroll content down (later lines visible).
Scroll content up.
Types
@type t() :: %MingaEditor.HoverPopup{ anchor_col: non_neg_integer(), anchor_row: non_neg_integer(), content_lines: [MingaAgent.Markdown.parsed_line()], focused: boolean(), scroll_offset: non_neg_integer() }
A hover popup state.
Functions
Focus into the hover popup for scrolling.
@spec new(String.t(), non_neg_integer(), non_neg_integer()) :: t()
Creates a new hover popup from LSP hover content.
Parses the markdown content and anchors the popup at the given cursor position.
@spec render(t(), {pos_integer(), pos_integer()}, map()) :: [ MingaEditor.DisplayList.draw() ]
Renders the hover popup as a list of display list draws.
Returns an empty list if the content is empty. The draws are absolute screen coordinates ready for an Overlay.
Scroll content down (later lines visible).
Scroll content up.