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

Function embedded

scripts/gen-go-stdlib-methods.mjs:112–121  ·  view source on GitHub ↗
(type, imports)

Source from the content-addressed store, hash-verified

110 for (const [m, arity] of more) if (!methods.has(m)) methods.set(m, arity);
111 };
112 const embedded = (type, imports) => {
113 if (type?.type === 'pointer_type') type = type.namedChildren[0];
114 if (type?.type === 'generic_type') type = type.childForFieldName('type');
115 if (type?.type === 'qualified_type') {
116 take(methodsOf(imports.get(type.childForFieldName('package').text), type.childForFieldName('name').text, seen));
117 } else if (type?.type === 'type_identifier') {
118 if (type.text === 'error') take(new Map([['Error', '0/1']]));
119 else take(methodsOf(importPath, type.text, seen));
120 }
121 };
122 const type = declared.type;
123 if (type?.type === 'interface_type') {
124 for (const element of type.namedChildren) {

Callers 1

methodsOfFunction · 0.85

Calls 3

takeFunction · 0.70
methodsOfFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected