Skip to main content

Module language_catalog

Module language_catalog 

Source
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§

GrammarProvenance
A grammar that parses a registered language by default.
LanguageEntry
One registered language.
NativeGrammarEntry
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.