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

Function ownMethods

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

Source from the content-addressed store, hash-verified

1101 const ownMemo = new Map<string, Set<string>>();
1102 const ownSignatures = new Map<string, Map<string, (string | undefined)[]>>();
1103 const ownMethods = (id: string): Set<string> => {
1104 let names = ownMemo.get(id);
1105 if (!names) {
1106 names = new Set();
1107 const signatures = new Map<string, (string | undefined)[]>();
1108 for (const e of queries.getOutgoingEdges(id, ['contains'])) {
1109 const n = queries.getNodeById(e.target);
1110 if (!n || n.kind !== 'method') continue;
1111 const key = goMethodKey(n);
1112 names.add(key);
1113 const list = signatures.get(key);
1114 if (list) list.push(n.signature);
1115 else signatures.set(key, [n.signature]);
1116 }
1117 ownMemo.set(id, names);
1118 ownSignatures.set(id, signatures);
1119 }
1120 return names;
1121 };
1122
1123 // The types one embeds: an interface embeds interfaces, a struct any of the
1124 // three. Every type's are read up front in a few batched queries rather than

Callers 4

methodNamesFunction · 0.85
methodAritiesFunction · 0.85
methodTypesFunction · 0.85
goImplementsEdgesFunction · 0.85

Calls 7

goMethodKeyFunction · 0.85
pushMethod · 0.80
getMethod · 0.65
getNodeByIdMethod · 0.65
getOutgoingEdgesMethod · 0.45
addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected