Skip to main content

Module builtins

Module builtins 

Source
Expand description

Built-in snippet packs embedded in the binary.

Bundled friendly-snippets-compatible JSON packs (the same TextMate format crate::load::load_pack reads) so a fresh editor has a useful starter set without the user installing anything. They load at boot into the shared SnippetRegistry; user packs in ~/.config/lattice/snippets overlay them via :reload-snippets.

Adding a language: drop <language>.json under crates/lattice-snippet/snippets/ and add an include_str! line to builtin_packs. _global.json maps to the "*" all-languages bucket.

Functionsยง

builtin_packs
(language, pack-json) for every embedded pack. "*" is the all-languages bucket (the snippet source walks it alongside the active language).
load_builtins
Build a fresh registry holding every built-in pack.
load_builtins_into
Overlay the built-in packs onto an existing registry. Used by :reload-snippets to seed the rebuild before user packs (so user packs augment / override the built-ins rather than the reload wiping them).