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§
- Bash
Mode - CMode
- CppMode
- CssMode
- GoMode
- Html
Mode - Java
Mode - Javascript
Mode - Json
Mode - LuaMode
- Markdown
Mode - Python
Mode - Ruby
Mode - Rust
Mode - SqlMode
- Toml
Mode - Tree
Sitter Completion Mode tree-sitter-completion-mode(CSM.6). Contributes the tree-sitter symbol source while active. Auto-activates on Document buffers viaauto_activated_minors_for_buffer_kindinlattice-ui-tui::modes.popup_filter_chord = Some('t')⇒<C-t>insidecompletion-popup-modenarrows the popup to tree-sitter symbols only.- Tree
Sitter Symbol Source - The
SyncCompletionSourceimpl that emits tree-sitter local-symbol candidates. Stateless – reads the pre-computed symbol slice offInsertContext::tree_sitter_symbols(the host walkscollect_symbols()once per populate). Filters out the cursor’s own current query so the user doesn’t get “complete this word with itself.” - TsxMode
- Type
Script Mode - WitMode
- Yaml
Mode
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>.prioritykey off this string.
Functions§
- lang_
for_ mode_ id - Resolve a major-mode id back to its corresponding
Lang. ReturnsNonewhen the mode has no language binding (e.g.TextMode, minor modes). - major_
mode_ id_ for_ lang - Resolve a
Langto its corresponding major-mode id.Lang::PlainreturnsNonebecausetext-mode(the fallback) is owned bylattice-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).