Skip to main content

Module modes

Module modes 

Source
Expand description

Per-language major modes.

Each variant of crate::lang::Lang (other than Plain) has a corresponding major mode declared here. The modes are pure declarations in this slice (M.3.0) – their option contributions, keymap layers, and lifecycle hooks are empty / no-op. Real declarative content (indent rules, tree-sitter parser attach, default LSP attach, comment syntax) lands as the corresponding subsystems migrate to the mode model in later slices.

Plain maps to lattice_mode::TextMode; no separate plain-mode declaration here.

All language modes register through register_language_modes.

Structs§

BashMode
CMode
CppMode
CssMode
GoMode
HtmlMode
JavaMode
JavascriptMode
JsonMode
LuaMode
MarkdownMode
PythonMode
RubyMode
RustMode
SqlMode
TomlMode
TreeSitterCompletionMode
tree-sitter-completion-mode (CSM.6). Contributes the tree-sitter symbol source while active. Auto-activates on Document buffers via auto_activated_minors_for_buffer_kind in lattice-ui-tui::modes. popup_filter_chord = Some('t') ⇒ <C-t> inside completion-popup-mode narrows the popup to tree-sitter symbols only.
TreeSitterSymbolSource
The SyncCompletionSource impl that emits tree-sitter local-symbol candidates. Stateless – reads the pre-computed symbol slice off InsertContext::tree_sitter_symbols (the host walks collect_symbols() once per populate). Filters out the cursor’s own current query so the user doesn’t get “complete this word with itself.”
TsxMode
TypeScriptMode
WitMode
YamlMode

Constants§

TREE_SITTER_COMPLETION_SOURCE_ID
Stable id for the tree-sitter symbol completion source. Must match lattice_completion::TREE_SITTER_SYMBOL_SOURCE_ID – the host’s per-language allowlist and :set completion.source.<id>.priority key off this string.

Functions§

lang_for_mode_id
Resolve a major-mode id back to its corresponding Lang. Returns None when the mode has no language binding (e.g. TextMode, minor modes).
major_mode_id_for_lang
Resolve a Lang to its corresponding major-mode id. Lang::Plain returns None because text-mode (the fallback) is owned by lattice-mode; the caller falls through to that when the lookup misses.
register_language_modes
Register every language major mode against registry. Called from the App’s mode-registry boot path. Idempotent only by duplication (registry’s existing invariant).