* `name -> target qualified name` for every reference the named function or * method in `file` resolves — a call to a struct is an `instantiates` edge.
(cg: CodeGraph, file: string, name: string)
| 30 | * method in `file` resolves — a call to a struct is an `instantiates` edge. |
| 31 | */ |
| 32 | function callsFrom(cg: CodeGraph, file: string, name: string): string[] { |
| 33 | const from = cg.getNodesInFile(file).filter((n) => n.name === name && (n.kind === 'function' || n.kind === 'method')); |
| 34 | expect(from.length).toBeGreaterThan(0); |
| 35 | return cg |
| 36 | .getOutgoingEdgesFrom(from.map((n) => n.id)) |
| 37 | .flatMap((e) => { |
| 38 | const refName = (e.metadata as { refName?: string } | undefined)?.refName; |
| 39 | return refName ? [`${refName} -> ${cg.getNode(e.target)!.qualifiedName}`] : []; |
| 40 | }) |
| 41 | .sort(); |
| 42 | } |
| 43 | |
| 44 | const PB_INTERNAL = `#pragma once |
| 45 | namespace pb { |
no test coverage detected