MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / ifaceMethods

Function ifaceMethods

src/resolution/callback-synthesizer.ts:1677–1695  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

1675 };
1676 const ifaceMemo = new Map<string, Set<string>>();
1677 const ifaceMethods = (id: string): Set<string> => {
1678 let names = ifaceMemo.get(id);
1679 if (!names) {
1680 names = new Set<string>();
1681 const reached = new Set<string>([id]);
1682 const pending = [id];
1683 while (pending.length > 0) {
1684 const at = pending.pop()!;
1685 for (const m of methodsOf(at)) names.add(goMethodKey(m));
1686 for (const e of embeds(at)) {
1687 if (reached.has(e.target)) continue;
1688 reached.add(e.target);
1689 pending.push(e.target);
1690 }
1691 }
1692 ifaceMemo.set(id, names);
1693 }
1694 return names;
1695 };
1696 const provides = (id: string, key: string): boolean =>
1697 kindOf(id) === 'interface' ? ifaceMethods(id).has(key) : methodsOf(id).some((m) => goMethodKey(m) === key);
1698

Callers 1

providesFunction · 0.85

Calls 8

goMethodKeyFunction · 0.85
embedsFunction · 0.85
hasMethod · 0.80
pushMethod · 0.80
methodsOfFunction · 0.70
getMethod · 0.65
addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected