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

Function methodNames

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

Source from the content-addressed store, hash-verified

1179 // Own methods plus every embedded type's, a standard-library one's too.
1180 const NONE_OPAQUE: ReadonlySet<string> = new Set();
1181 const methodNames = (id: string): GoMethodNames => {
1182 const types = embedClosure(id);
1183 if (types.length === 1 && !outside.has(id)) return { methods: ownMethods(id), opaque: NONE_OPAQUE };
1184 const methods = new Set<string>();
1185 const opaque = new Set<string>();
1186 for (const t of types) {
1187 for (const m of ownMethods(t)) methods.add(m);
1188 const out = outside.get(t);
1189 if (!out) continue;
1190 for (const known of out.stdlib) for (const key of known.keys()) methods.add(key);
1191 for (const type of out.opaque) opaque.add(type);
1192 }
1193 return { methods, opaque };
1194 };
1195
1196 const covers = (have: Set<string>, want: Set<string>): boolean => {
1197 if (have.size < want.size) return false;

Callers 1

goImplementsEdgesFunction · 0.70

Calls 5

embedClosureFunction · 0.85
ownMethodsFunction · 0.85
hasMethod · 0.80
getMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected