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 publishesLspBufferAttached; the typed Guard publishesLspBufferDetachedon drop. -
LSP sub-modes (minors; M.6.0) – one per LSP feature surface. Each is independently toggleable on top of
lsp-mode. Marker modes withtype 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) – couplesfoldmethodto the LSPfoldingRangefeature. Owns a typed Guard holding(prior_foldmethod, config_handle); Drop restores the prior value.
Re-exports§
pub use crate::completion::LspCompletionMode;
Structs§
- LspCode
Action Mode - LspDiagnostics
Data - Render-time service data for
LspMode::gutter_decorations. The renderer registers one instance per pane render, populated fromrs.diagnostics.layer.diagnostics_arc(uri)for the pane’s buffer URI.Nonediagnostics means no URI mapped or no LSP attachment — no severity decorations are contributed. - LspDiagnostics
Mode lsp-diagnostics-mode— owns the diagnostic cursor surfaces (L4b). Promoted from thelsp_sub_mode!marker so it can carry a keymap + theglaction handler.- LspDocument
Highlight Mode - LspFolding
Mode - Guard for
lsp-folding-mode. Holds the priorfoldmethodvalue + a config handle; Drop restores the prior value viafolding_sync::on_deactivate.Noneprior means activation was a no-op (foldmethod was alreadyLsp), so Drop also does nothing. 4.4.f:textDocument/foldingRangefeedingFoldMethod::Lsp. - LspFormat
Mode - LspHover
Mode - LspInlay
Hint Mode - LspLog
Mode lsp-log-mode– major mode for the subsystem-wide*lsp*buffer (B’.3). Same Drop-based subscription cleanup asLspServerLogMode.- LspMode
lsp-mode– the umbrella minor that gates LSP traffic on a buffer. Cascades to the 15 sub-modes viaMode::implies().- LspMode
Guard - Guard for
lsp-mode. Holds the event-bus handle + buffer id; Drop publishesLspBufferDetachedso subscribers (the LSP supervisor, the diagnostic clearer) tear down per-buffer state symmetrically with theLspBufferAttachedpublished fromon_activate. - LspNav
Mode - LspProgress
Mode lsp-progress-mode— a marker minor mode (ML.3c removed its hand-writtenstatus_line_items; the in-flight$/progressdetail now ships as part of thelspmodeline element produced bycrate::modeline). Kept as a distinct mode so existing activation / gating keys off it unchanged.- LspRename
Mode - LspSelection
Range Mode - LspSemantic
Tokens Mode - LspServer
LogMode lsp-server-log-mode– major mode for the per-instance*lsp:<server>:<workspace>*buffer (B’.4 / B’.7).on_activatederives its [InstanceKey] identity by parsing the buffer’s synthetic name, subscribes toLspLogPushed, and spawns a drain task that appends matching records. The returned [LogSubscriptionGuard] unsubscribes on drop.- LspSignature
Mode - LspSymbols
Mode - LspTrace
LogMode lsp-trace-log-mode– per-instance trace buffer (B’.5 / B’.7). Twin ofLspServerLogModefor trace-only records.
Traits§
- Diagnostics
Query - L4b: read-only query handle the mode-owned diagnostic handlers in
LspDiagnosticsModeuse to read the cursor line’s diagnostics forgl. The impl (lattice-host) resolvesbuffer_id → uri → DiagnosticsLayerover 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 theDiagnosticsQueryHandlealias (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 → emptyVec(the host echoes “no diagnostics on line”). - register_
lsp_ log_ modes - Register every LSP mode (the three log majors, the umbrella
lsp-modeminor, and the marker sub-modes) againstregistry.LspCompletionModeis registered separately viacrate::completion::register_lsp_completion_modebecause it needs a supervisor handle.
Type Aliases§
- Diagnostics
Query Handle - Service alias for
DiagnosticsQuery. Register the host impl as this exact type and look it up the same way.