Skip to main content

Module help_views

Module help_views 

Source
Expand description

LSP-specific help-buffer factories (DESIGN.md §5.11).

These produce [lattice_help::HelpContent] from LSP runtime state (the diagnostics layer, supervisor, logger, etc.). They live in lattice-lsp rather than lattice-help because they read LSP types – the help crate has no awareness of LSP and should stay that way (one extension model, one substrate). Callers in the editor App invoke these directly when servicing :diagnostics / :lsp-status / :lsp-log / :references.

Each function returns an unsyntaxed [HelpContent]; help buffers receive their markdown syntax and link styling from the live cells-worker DisplayMatrix once displayed.

Functions§

diagnostics_help
Build a help buffer listing every workspace diagnostic (Phase 4.1.d.iv). Each diagnostic renders as one [severity] [path:line:col message](file:path:line) row – the markdown link is parsed by extract_links_and_clean into a HelpLinkTarget::Source that the existing do_help_follow_link path knows how to dispatch (jumps to the file at the given line).
lsp_global_log_help
Build the *lsp* subsystem-wide log view (Phase 4.1.g). Snapshots logger.snapshot_global() and renders one row per record: <timestamp> <level> <source> <message>.
lsp_server_log_help
Build a per-instance log view (*lsp:<server>:<workspace>*). Filters out trace records (those land in lsp_server_trace_help).
lsp_server_log_listing_help
Build the :lsp-server-log picker – one row per running actor with workspace root + buffer count + capability summary in the margin, each row carrying an exec: link to its log + trace. Use /query (vim regex search) to filter; press <CR> on a link to open. A real fuzzy picker arrives with the bundled fuzzy-finder plugin (Phase 8b); for now this listing keeps everything reachable through the existing help-buffer machinery.
lsp_server_trace_help
Build the JSON-RPC trace view (*lsp:<server>:<workspace>:trace*). Filters to LogSource::Trace records only. Empty when trace mode hasn’t been on.
lsp_status_help
Build the :lsp-status view – one row per running actor (id, workspace root, server-side capability summary).
summarise_capabilities
One-line summary of a server’s negotiated capabilities. Used in the :lsp-server-log picker margin so a glance tells the user “this server has hover + completion but not references” without having to dig into :lsp-status.