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

Function goFnRefSite

src/extraction/function-ref.ts:928–937  ·  view source on GitHub ↗
(node: SyntaxNode)

Source from the content-addressed store, hash-verified

926
927/** {@link GoFnRefSite} of the value container `node`. */
928export function goFnRefSite(node: SyntaxNode): GoFnRefSite {
929 let scope = -1;
930 let literal: SyntaxNode | null = null;
931 for (let cur: SyntaxNode | null = node; cur; cur = cur.parent) {
932 if (scope < 0 && GO_SCOPE_TYPES.has(cur.type)) scope = cur.id;
933 if (cur.type === 'function_declaration' || cur.type === 'method_declaration') return { scope, unit: cur };
934 if (cur.type === 'func_literal') literal = cur;
935 }
936 return { scope, unit: literal };
937}
938
939/**
940 * The names among `names` that a Go function binds itself, keyed

Callers 1

goScopedFnRefScopesFunction · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected