Where each call through `refName` landed: ` -> :: `.
(graph: CodeGraph, refName: string)
| 76 | |
| 77 | /** Where each call through `refName` landed: `<caller> -> <target kind> <file>::<qualified name>`. */ |
| 78 | function targetsOf(graph: CodeGraph, refName: string): string[] { |
| 79 | const ids = graph.getFiles().flatMap((file) => graph.getNodesInFile(file.path)).map((n) => n.id); |
| 80 | return graph.getOutgoingEdgesFrom(ids) |
| 81 | .filter((e) => e.metadata?.refName === refName && e.kind !== 'imports') |
| 82 | .map((e) => { |
| 83 | const target = graph.getNode(e.target)!; |
| 84 | return `${graph.getNode(e.source)!.name} -> ${target.kind} ${target.filePath}::${target.qualifiedName}`; |
| 85 | }) |
| 86 | .sort(); |
| 87 | } |
| 88 | |
| 89 | /** Index `before`, write `after` over it, sync; return the graph and what a full index of `after` holds. */ |
| 90 | async function syncEdit(before: Files, after: Files): Promise<{ root: string; graph: CodeGraph; full: string[] }> { |
no test coverage detected