Where the `calls` edges written in `file` lead, as `name @ file:line` of each target.
(cg: CodeGraph, file: string)
| 61 | |
| 62 | /** Where the `calls` edges written in `file` lead, as `name @ file:line` of each target. */ |
| 63 | function callsFrom(cg: CodeGraph, file: string): string[] { |
| 64 | const out: string[] = []; |
| 65 | for (const caller of [...cg.getNodesByKind('method'), ...cg.getNodesByKind('function')]) { |
| 66 | if (caller.filePath !== file) continue; |
| 67 | for (const r of cg.getCallees(caller.id)) { |
| 68 | if (r.edge.kind === 'calls') out.push(`${r.node.name} @ ${r.node.filePath}:${r.node.startLine}`); |
| 69 | } |
| 70 | } |
| 71 | return out.sort(); |
| 72 | } |
| 73 | |
| 74 | const lines = (...l: string[]): string => [...l, ''].join('\n'); |
| 75 |
no test coverage detected