MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / getCompiledQueries

Function getCompiledQueries

website/src/lib/parser.worker.ts:574–589  ·  view source on GitHub ↗
(lang: any, queryKey: string)

Source from the content-addressed store, hash-verified

572const compiledQueryCache = new Map<string, Record<string, Query | null>>();
573
574function getCompiledQueries(lang: any, queryKey: string): Record<string, Query | null> {
575 if (compiledQueryCache.has(queryKey)) return compiledQueryCache.get(queryKey)!;
576 const spec = QUERIES[queryKey];
577 const compiled: Record<string, Query | null> = {};
578 for (const [k, src] of Object.entries(spec)) {
579 if (!src.trim()) { compiled[k] = null; continue; }
580 try {
581 compiled[k] = new Query(lang, src);
582 } catch (e) {
583 console.warn(`[parser.worker] Query compile error [${queryKey}:${k}]:`, e);
584 compiled[k] = null;
585 }
586 }
587 compiledQueryCache.set(queryKey, compiled);
588 return compiled;
589}
590
591// ---------------------------------------------------------------------------
592// State

Callers 1

processNextBatchFunction · 0.85

Calls 3

hasMethod · 0.65
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected