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

Function resolveSymbol

website/src/lib/parser.worker.ts:739–748  ·  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

737 * from the same file as the caller to avoid cross-file collisions.
738 */
739function resolveSymbol(key: string, callerFile?: string): number | undefined {
740 const candidates = nodeSymbolIndex.get(key);
741 if (!candidates?.length) return undefined;
742 if (candidates.length === 1) return candidates[0];
743 if (callerFile) {
744 const sameFile = candidates.find(id => nodes[id - 1]?.file === callerFile);
745 if (sameFile !== undefined) return sameFile;
746 }
747 return candidates[0];
748}
749
750async function processNextBatch() {
751 if (pendingFileQueue.length === 0) {

Callers 1

processNextBatchFunction · 0.70

Calls 1

getMethod · 0.65

Tested by

no test coverage detected