Skip to main content

Module modes

Module modes 

Source
Expand description

LSP modes.

  • lsp-mode (minor; M.5.0) – the umbrella gate. When active on a buffer, LSP traffic flows: requests are issued, diagnostics are applied, document sync runs. The activate hook publishes LspBufferAttached; the typed Guard publishes LspBufferDetached on drop.

  • LSP sub-modes (minors; M.6.0) – one per LSP feature surface. Each is independently toggleable on top of lsp-mode. Marker modes with type Guard = ().

  • lsp-log-mode / lsp-trace-log-mode / lsp-server-log-mode (majors; M.3.0 / B’.3 / B’.4 / B’.5) – the read-only buffers backing the LSP observability surfaces. Each owns a typed Guard holding its event-bus subscription handle; Drop unsubscribes (M-async.1 Drop-based cleanup contract per mode-architecture.md §7.1).

  • lsp-folding-mode (minor; 4.4.f) – couples foldmethod to the LSP foldingRange feature. Owns a typed Guard holding (prior_foldmethod, config_handle); Drop restores the prior value.

Re-exports§

pub use crate::completion::LspCompletionMode;

Structs§

LspCodeActionMode
LspDiagnosticsData
Render-time service data for LspMode::gutter_decorations. The renderer registers one instance per pane render, populated from rs.diagnostics.layer.diagnostics_arc(uri) for the pane’s buffer URI. None diagnostics means no URI mapped or no LSP attachment — no severity decorations are contributed.
LspDiagnosticsMode
lsp-diagnostics-mode — owns the diagnostic cursor surfaces (L4b). Promoted from the lsp_sub_mode! marker so it can carry a keymap + the gl action handler.
LspDocumentHighlightMode
LspFoldingMode
Guard for lsp-folding-mode. Holds the prior foldmethod value + a config handle; Drop restores the prior value via folding_sync::on_deactivate. None prior means activation was a no-op (foldmethod was already Lsp), so Drop also does nothing. 4.4.f: textDocument/foldingRange feeding FoldMethod::Lsp.
LspFormatMode
LspHoverMode
LspInlayHintMode
LspLogMode
lsp-log-mode – major mode for the subsystem-wide *lsp* buffer (B’.3). Same Drop-based subscription cleanup as LspServerLogMode.
LspMode
lsp-mode – the umbrella minor that gates LSP traffic on a buffer. Cascades to the 15 sub-modes via Mode::implies().
LspModeGuard
Guard for lsp-mode. Holds the event-bus handle + buffer id; Drop publishes LspBufferDetached so subscribers (the LSP supervisor, the diagnostic clearer) tear down per-buffer state symmetrically with the LspBufferAttached published from on_activate.
LspNavMode
LspProgressMode
lsp-progress-mode — a marker minor mode (ML.3c removed its hand-written status_line_items; the in-flight $/progress detail now ships as part of the lsp modeline element produced by crate::modeline). Kept as a distinct mode so existing activation / gating keys off it unchanged.
LspRenameMode
LspSelectionRangeMode
LspSemanticTokensMode
LspServerLogMode
lsp-server-log-mode – major mode for the per-instance *lsp:<server>:<workspace>* buffer (B’.4 / B’.7). on_activate derives its [InstanceKey] identity by parsing the buffer’s synthetic name, subscribes to LspLogPushed, and spawns a drain task that appends matching records. The returned [LogSubscriptionGuard] unsubscribes on drop.
LspSignatureMode
LspSymbolsMode
LspTraceLogMode
lsp-trace-log-mode – per-instance trace buffer (B’.5 / B’.7). Twin of LspServerLogMode for trace-only records.

Traits§

DiagnosticsQuery
L4b: read-only query handle the mode-owned diagnostic handlers in LspDiagnosticsMode use to read the cursor line’s diagnostics for gl. The impl (lattice-host) resolves buffer_id → uri → DiagnosticsLayer over the live published render state, so the mode needs no host method, no direct layer access, and no URI map of its own. Register + look up under the DiagnosticsQueryHandle alias (feedback_servicesregistry_arc_typeid).

Functions§

format_diagnostic_popup_lines
L4b: format the cursor line’s diagnostics into one popup line each: <severity glyph> <message> [source:code] (+N related). The glyph is the BMP-fallback severity mark (degrade-safe per the icon-palette rule); the message is collapsed to its first line. Empty input → empty Vec (the host echoes “no diagnostics on line”).
register_lsp_log_modes
Register every LSP mode (the three log majors, the umbrella lsp-mode minor, and the marker sub-modes) against registry. LspCompletionMode is registered separately via crate::completion::register_lsp_completion_mode because it needs a supervisor handle.

Type Aliases§

DiagnosticsQueryHandle
Service alias for DiagnosticsQuery. Register the host impl as this exact type and look it up the same way.