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

Function resolveWasmPath

src/extraction/grammars.ts:344–349  ·  view source on GitHub ↗

Absolute path of a language's grammar WASM (vendored or tree-sitter-wasms).

(lang: GrammarLanguage)

Source from the content-addressed store, hash-verified

342
343/** Absolute path of a language's grammar WASM (vendored or tree-sitter-wasms). */
344function resolveWasmPath(lang: GrammarLanguage): string {
345 const wasmFile = WASM_GRAMMAR_FILES[lang];
346 return VENDORED_WASM_LANGS.has(lang)
347 ? path.join(__dirname, 'wasm', wasmFile)
348 : require.resolve(`tree-sitter-wasms/out/${wasmFile}`);
349}
350
351/**
352 * Expand an index set's languages to the grammars actually needed to parse it.

Callers 2

readGrammarWasmBytesFunction · 0.85
loadGrammarsForLanguagesFunction · 0.85

Calls 3

hasMethod · 0.80
resolveMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected