Skip to main content

Module contributions

Module contributions 

Source
Expand description

Declarative contributions on crate::Mode.

Keymap and KeymapBinding moved to lattice-keymap::contribution in K.3 (2026-06-07) — re-exported here for backward compatibility.

Stubs still pending real impls:

Structs§

BuiltinSignIds
The interned ids of the built-in signs (SG.4a).
CompilationSeverityData
Render-time carrier for compilation-mode’s severity gutter marks. The off-thread compilation drain builds a per-buffer severity index and ships it to the host (AppEffect::CompilationGutterSet), which stores it in render_state; the renderer reads that slot for the pane’s buffer and registers this into the DecorationCtx’s ServiceRegistry. CompilationMode::gutter_decorations then pulls it and maps each (line, level) to a GutterDecoration::Sign naming the built-in diagnostic sign for that level (BuiltinSignIds::for_severity) — the same mark an LSP diagnostic paints (CM.3c; before SG.4b this was a dedicated Severity variant).
DecorationCtx
Read-only context passed to crate::Mode::gutter_decorations.
DecorationProvider
Stub. Reserved for the WIT plugin-facing contribution surface (M.10). Not used by the Mode trait today — see Mode::gutter_decorations for the live decoration path.
DiagnosticGlyphs
The four ui.diagnostic-*-glyph values, read once by the caller so lattice-mode needs no typed-options dependency.
Keymap
A mode’s full keymap contribution.
KeymapBinding
One mode-contributed keymap binding.
SignDefinition
A sign definition: what it looks like, how it is styled, how it competes for its cell (SG.1).
SignId
A definition’s interned handle (SG.1).
SignRegistry
The registered sign definitions (SG.1).
Subscription
RAII subscription handle. Unsubscribes from the event bus on drop.

Enums§

GutterDecoration
A single gutter decoration contributed by a crate::Mode. Each variant maps to one physical gutter column.
GutterDiffKind
Renderer-agnostic diff-sign kind for the gutter diff column. Mirrors DiffSignKind without importing lattice-host.
GutterSeverityLevel
Renderer-agnostic diagnostic severity level for the gutter severity column. Ordered ascending by severity so max() selects the most severe: Hint < Info < Warning < Error.

Constants§

BUILTIN_SIGN_COLUMNS
The built-in gutter columns, left to right (SG.4a).
DIAGNOSTIC_ERROR_PRIORITY
The highest built-in. A sign must EXCEED this to take the cell from an error.
DIAGNOSTIC_HINT_PRIORITY
The lowest diagnostic, level with vim’s default sign priority.
DIAGNOSTIC_INFO_PRIORITY
Priority of the built-in diagnostic.info sign: above a hint, below a warning.
DIAGNOSTIC_WARNING_PRIORITY
Priority of the built-in diagnostic.warning sign: above info, below an error.
DIFF_SIGN_PRIORITY
Diff marks never contend with each other — a line belongs to at most one hunk — so they share one priority, and it is the vim default because nothing about a hunk mark argues for out-ranking a plugin’s sign in a column plugins do not normally use.
SIGN_COLUMN_DIFF
The git-diff column, between the mark column and the line numbers. Separate from SIGN_COLUMN_MARK so a diagnostic cannot hide a hunk mark (SG.4a).
SIGN_COLUMN_MARK
The leftmost gutter column: diagnostics, compilation severity, and any sign that does not name a column of its own. Vim’s signcolumn (SG.4a).

Functions§

register_builtin_signs
Register the built-in signs into registry and return their ids (SG.4a).
winning_sign
Pick the winner when several signs land on one line (SG.1).

Type Aliases§

SignRegistryHandle
Register and look up with this exact alias (the ServiceRegistry TypeId rule).