Expand description
Generic TOML table inheritance merge — the primitive both the language
plugins (defaults.toml ⊕ [base] ⊕ <lang>.toml) and the CLI (built-in defaults
⊕ a project code-ranker.toml) layer config with. Lives in
code-ranker-plugin-api so neither consumer reaches into a sibling crate.
§Merge semantics (deep_merge)
For each key of overlay applied onto base:
- table vs table → recurse (per-key deep merge).
[[presets]]array of tables → merge byid: an overlay preset with anidalready present in the base replaces that entry in place; a newidis appended.- array patched by an op-table (
{add,remove,replace,clear,prepend,…}) → the inherited list is mutated in place (seecrate::list_override); a plain array still replaces it wholesale. - any other value (scalar, plain array, table-vs-non-table) → the overlay value replaces the base value outright.
Keys present only in one side are kept as-is.
Functions§
- deep_
merge - Deep-merge
overlayontobase(see module docs for the rules). - merge_
presets - Merge two
[[presets]]arrays by theidfield: an overlay preset whoseidmatches a base entry replaces it in place; a newidis appended. Entries without a stringidare appended verbatim.