Expand description
The registered language catalog shared with the JavaScript runtime.
src/data/language-catalog.json is generated from
parity/language-grammar-inventory.json by
js/scripts/build-language-catalog.mjs; the npm package ships the same
file, so both runtimes agree on every alias, file extension, and default
grammar.
Structs§
- Grammar
Provenance - A grammar that parses a registered language by default.
- Language
Entry - One registered language.
- Native
Grammar Entry - A native Links Notation grammar of the catalog, which parses its languages by default, with the kinds its tree places as its tree-sitter oracle does.
Functions§
- canonical_
language_ name - Returns the canonical inventory name for a language name or alias.
- grammar_
provenance - Returns the grammars that parse a language by default.
- language_
candidates_ for_ path - Returns every language registered for a file path, most specific first: languages whose extension is a longer case-insensitive suffix of the path come before shorter ones, and ties keep catalog order.
- language_
catalog - Returns every registered language in inventory order.
- language_
entry - Returns the catalog entry for a language name or alias (case-insensitive).
- language_
for_ path - Returns the language a file path dispatches to.
- native_
grammar - Returns the native grammar of the catalog with id
id. - native_
grammars - Returns every native grammar of the catalog.
- oracle_
grammar_ provenance - Returns the pinned tree-sitter grammars a language’s native default grammar replaced, which stay its oracles; empty for a language without a native default grammar.