()
| 124 | } |
| 125 | |
| 126 | async function ensureParserInitialized(): Promise<void> { |
| 127 | if (!initPromise) { |
| 128 | initPromise = Parser.init({ |
| 129 | locateFile(scriptName: string) { |
| 130 | if (scriptName === 'tree-sitter.wasm') { |
| 131 | return CORE_WASM_PATH; |
| 132 | } |
| 133 | return scriptName; |
| 134 | } |
| 135 | }); |
| 136 | } |
| 137 | |
| 138 | await initPromise; |
| 139 | } |
| 140 | |
| 141 | async function loadLanguage(language: string): Promise<Language> { |
| 142 | const wasmFile = CURATED_LANGUAGE_TO_WASM[language]; |
no outgoing calls
no test coverage detected