MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / resolveGrammarPath

Function resolveGrammarPath

src/grammars/manifest.ts:62–73  ·  view source on GitHub ↗
(
  language: string,
  moduleUrl: string
)

Source from the content-addressed store, hash-verified

60 * @returns `{ wasmFile, wasmPath }` or throws if the language is not curated.
61 */
62export function resolveGrammarPath(
63 language: string,
64 moduleUrl: string
65): { wasmFile: string; wasmPath: string } {
66 const wasmFile = CURATED_LANGUAGE_TO_WASM[language];
67 if (!wasmFile) {
68 throw new Error(`No curated grammar for language '${language}'.`);
69 }
70
71 const grammarDir = resolveGrammarDir(moduleUrl);
72 return { wasmFile, wasmPath: path.join(grammarDir, wasmFile) };
73}

Callers 1

loadLanguageFunction · 0.85

Calls 1

resolveGrammarDirFunction · 0.85

Tested by

no test coverage detected