Where each reference to `refName` landed: ` -> :: `.
(graph: CodeGraph, refName: string)
| 90 | |
| 91 | /** Where each reference to `refName` landed: `<source> -> <target kind> <file>::<qualified name>`. */ |
| 92 | function targetsOf(graph: CodeGraph, refName: string): string[] { |
| 93 | const ids = graph.getFiles().flatMap((file) => graph.getNodesInFile(file.path)).map((n) => n.id); |
| 94 | return graph.getOutgoingEdgesFrom(ids) |
| 95 | .filter((e) => e.metadata?.refName === refName && e.kind !== 'imports') |
| 96 | .map((e) => { |
| 97 | const target = graph.getNode(e.target)!; |
| 98 | return `${graph.getNode(e.source)!.name} -> ${target.kind} ${target.filePath}::${target.qualifiedName}`; |
| 99 | }) |
| 100 | .sort(); |
| 101 | } |
| 102 | |
| 103 | /** Index `before`, write `after` over it, sync; return the graph and what a full index of `after` holds. */ |
| 104 | async function syncEdit(before: Files, after: Files): Promise<{ root: string; graph: CodeGraph; full: string[]; modified: number }> { |
no test coverage detected