* 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[])
| 358 | * cfscript/cfquery grammars (see injections.scm in tree-sitter-cfml). |
| 359 | */ |
| 360 | function 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 |
no outgoing calls
no test coverage detected