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