(node: SyntaxNode)
| 909 | |
| 910 | /** {@link GoFnRefSite} of the value container `node`. */ |
| 911 | export function goFnRefSite(node: SyntaxNode): GoFnRefSite { |
| 912 | let scope = -1; |
| 913 | let literal: SyntaxNode | null = null; |
| 914 | for (let cur: SyntaxNode | null = node; cur; cur = cur.parent) { |
| 915 | if (scope < 0 && GO_SCOPE_TYPES.has(cur.type)) scope = cur.id; |
| 916 | if (cur.type === 'function_declaration' || cur.type === 'method_declaration') return { scope, unit: cur }; |
| 917 | if (cur.type === 'func_literal') literal = cur; |
| 918 | } |
| 919 | return { scope, unit: literal }; |
| 920 | } |
| 921 | |
| 922 | /** |
| 923 | * The names among `names` that a Go function binds itself, keyed |
no test coverage detected