(behaviour: Node, fn: string)
| 3265 | // implementer module's own exported `fn` function node. |
| 3266 | const targetCache = new Map<string, Node[]>(); |
| 3267 | const targetsOf = (behaviour: Node, fn: string): Node[] => { |
| 3268 | const cacheKey = `${behaviour.id}#${fn}`; |
| 3269 | let targets = targetCache.get(cacheKey); |
| 3270 | if (targets) return targets; |
| 3271 | targets = []; |
| 3272 | for (const e of queries.getIncomingEdges(behaviour.id, ['implements'])) { |
| 3273 | const impl = queries.getNodeById(e.source); |
| 3274 | if (!impl || impl.language !== 'erlang' || impl.kind !== 'namespace') continue; |
| 3275 | const fnNode = ctx |
| 3276 | .getNodesInFile(impl.filePath) |
| 3277 | .find((n) => n.kind === 'function' && n.name === fn && n.isExported !== false); |
| 3278 | if (fnNode) targets.push(fnNode); |
| 3279 | } |
| 3280 | targetCache.set(cacheKey, targets); |
| 3281 | return targets; |
| 3282 | }; |
| 3283 | |
| 3284 | // Pass 2 — dispatch sites. Only files containing a var-module call shape are |
| 3285 | // scanned in full. |
no test coverage detected