MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / matchIn

Function matchIn

graph-ui/src/pseudocode/imports-group.ts:428–447  ·  view source on GitHub ↗

One family of one callable declaration, searched for any import binding.

(family: ImportUsageFamily, names: readonly string[], ir: SemanticIR)

Source from the content-addressed store, hash-verified

426
427/** One family of one callable declaration, searched for any import binding. */
428function matchIn(family: ImportUsageFamily, names: readonly string[], ir: SemanticIR): Evidence[] | undefined {
429 switch (family) {
430 case 'calls': {
431 const index = ir.calls.value.findIndex((call) => names.includes(call.targetName));
432 return index < 0 ? undefined : citationOf(ir.calls, index);
433 }
434 case 'typeRefs': {
435 const index = (ir.typeRefs?.value ?? []).findIndex((entry) => names.includes(entry.name));
436 return index < 0 ? undefined : citationOf(ir.typeRefs, index);
437 }
438 case 'throws': {
439 const index = ir.throws.value.findIndex((entry) => names.includes(entry.type));
440 return index < 0 ? undefined : citationOf(ir.throws, index);
441 }
442 default: {
443 const index = ir.reads.value.findIndex((entry) => names.includes(entry.name));
444 return index < 0 ? undefined : citationOf(ir.reads, index);
445 }
446 }
447}
448
449/**
450 * True when every family the match would have come from was actually answered,

Callers 1

matchOfFunction · 0.85

Calls 1

citationOfFunction · 0.85

Tested by

no test coverage detected