What the symbol with this qualified name in `file` calls or references, as `kind name@file`.
(file: string, qualified: string)
| 201 | |
| 202 | /** What the symbol with this qualified name in `file` calls or references, as `kind name@file`. */ |
| 203 | function linksFrom(file: string, qualified: string): string[] { |
| 204 | const from = cg.getNodesInFile(file).filter((n) => n.qualifiedName === qualified && n.kind !== 'import'); |
| 205 | expect(from.length, `${qualified} should be indexed once in ${file}`).toBe(1); |
| 206 | return cg |
| 207 | .getOutgoingEdges(from[0]!.id) |
| 208 | .filter((e) => e.kind === 'calls' || e.kind === 'references') |
| 209 | .map((e) => ({ e, n: cg.getNode(e.target) })) |
| 210 | .filter((x): x is { e: typeof x.e; n: NonNullable<typeof x.n> } => !!x.n) |
| 211 | .map(({ e, n }) => `${e.kind} ${n.qualifiedName}@${n.filePath}`) |
| 212 | .sort(); |
| 213 | } |
| 214 | |
| 215 | const PROMPT = 'prompt@pkg/termui.py'; |
| 216 | const CONFIRM = 'confirm@pkg/termui.py'; |
no test coverage detected