GRAMMAR_REGISTRY

val GRAMMAR_REGISTRY: ScatterMap<Language, Lazy<IGrammarSource>>(source)

A registry of known languages that can parsed and tokenized.

To add a new language, do the following:

  • Obtain the grammar file from: https://github.com/shikijs/textmate-grammars-themes/tree/main/packages/tm-grammars/raw

  • The scopeName is a part of the JSON with the key scopeName.

  • Copy the grammar file into resources

  • Create a mapping from the Language to the name of the grammar resource.