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

Function resolveSymbol

website/src/lib/parser.worker.ts:587–596  ·  view source on GitHub ↗

* Resolve a symbol name to a single node ID, preferring candidates * from the same file as the caller to avoid cross-file collisions.

(key: string, callerFile?: string)

Source from the content-addressed store, hash-verified

585 * from the same file as the caller to avoid cross-file collisions.
586 */
587function resolveSymbol(key: string, callerFile?: string): number | undefined {
588 const candidates = nodeSymbolIndex.get(key);
589 if (!candidates?.length) return undefined;
590 if (candidates.length === 1) return candidates[0];
591 if (callerFile) {
592 const sameFile = candidates.find(id => nodes[id - 1]?.file === callerFile);
593 if (sameFile !== undefined) return sameFile;
594 }
595 return candidates[0];
596}
597
598async function processNextBatch() {
599 if (pendingFileQueue.length === 0) {

Callers 1

processNextBatchFunction · 0.70

Calls 1

getMethod · 0.65

Tested by

no test coverage detected