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

Function methodNames

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

Source from the content-addressed store, hash-verified

1243 // Own methods plus every embedded type's, a standard-library one's too.
1244 const NONE_OPAQUE: ReadonlySet<string> = new Set();
1245 const methodNames = (id: string): GoMethodNames => {
1246 const types = embedClosure(id);
1247 if (types.length === 1 && !outside.has(id)) return { methods: ownMethods(id), opaque: NONE_OPAQUE };
1248 const methods = new Set<string>();
1249 const opaque = new Set<string>();
1250 for (const t of types) {
1251 for (const m of ownMethods(t)) methods.add(m);
1252 const out = outside.get(t);
1253 if (!out) continue;
1254 for (const known of out.stdlib) for (const key of known.keys()) methods.add(key);
1255 for (const type of out.opaque) opaque.add(type);
1256 }
1257 return { methods, opaque };
1258 };
1259
1260 const covers = (have: Set<string>, want: Set<string>): boolean => {
1261 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