Skip to main content

build_dispatch

Function build_dispatch 

Source
pub fn build_dispatch(
    langs: &[&'static Language],
    ext_overrides: &BTreeMap<String, Vec<String>>,
) -> HashMap<String, &'static Language>
Expand description

Build an extension → language map for the given languages (the language carries both its analyzer and its canonical name, which the results cache records per entry).

Each language contributes its Language::exts, unless ext_overrides supplies a replacement list keyed by that language’s name or an alias (e.g. [ext] with es = ["ts"]). Extensions are lowercased so lookup is case-insensitive. Extensions are expected to be disjoint across languages; if two languages claim the same one, the first (registration order) wins.