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

Function methodNames

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

Source from the content-addressed store, hash-verified

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