MCPcopy Index your code
hub / github.com/CodeGraphContext/CodeGraphContext / getCompiledQueries

Function getCompiledQueries

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

Source from the content-addressed store, hash-verified

452const compiledQueryCache = new Map<string, Record<string, Query | null>>();
453
454function getCompiledQueries(lang: any, queryKey: string): Record<string, Query | null> {
455 if (compiledQueryCache.has(queryKey)) return compiledQueryCache.get(queryKey)!;
456 const spec = QUERIES[queryKey];
457 const compiled: Record<string, Query | null> = {};
458 for (const [k, src] of Object.entries(spec)) {
459 if (!src.trim()) { compiled[k] = null; continue; }
460 try {
461 compiled[k] = new Query(lang, src);
462 } catch (e) {
463 console.warn(`[parser.worker] Query compile error [${queryKey}:${k}]:`, e);
464 compiled[k] = null;
465 }
466 }
467 compiledQueryCache.set(queryKey, compiled);
468 return compiled;
469}
470
471// ---------------------------------------------------------------------------
472// State

Callers 1

processNextBatchFunction · 0.85

Calls 2

hasMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected