MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / expandGrammarLanguages

Function expandGrammarLanguages

src/extraction/grammars.ts:360–368  ·  view source on GitHub ↗

* Expand an index set's languages to the grammars actually needed to parse it. * SFC languages (svelte/vue/astro) have no grammar of their own — their * extractors delegate /frontmatter content to the TS/JS extractor, so * those grammars must be loaded even when no plain .ts/.js file is i

(languages: Language[])

Source from the content-addressed store, hash-verified

358 * cfscript/cfquery grammars (see injections.scm in tree-sitter-cfml).
359 */
360function expandGrammarLanguages(languages: Language[]): Language[] {
361 if (languages.some((l) => l === 'svelte' || l === 'vue' || l === 'astro')) {
362 languages = [...languages, 'typescript', 'javascript'];
363 }
364 if (languages.some((l) => l === 'cfml')) {
365 languages = [...languages, 'cfscript', 'cfquery'];
366 }
367 return languages;
368}
369
370/**
371 * Pre-read the grammar WASM bytes for an index set, keyed by language. The

Callers 2

readGrammarWasmBytesFunction · 0.85
loadGrammarsForLanguagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected