The branch label for `edge`'s call site in `siteNode`'s file, or ''.
( cg: CodeGraph, projectRoot: string, cache: Map<string, FileCache>, siteNode: Node, edge: Edge )
| 451 | |
| 452 | /** The branch label for `edge`'s call site in `siteNode`'s file, or ''. */ |
| 453 | async function whenAt( |
| 454 | cg: CodeGraph, |
| 455 | projectRoot: string, |
| 456 | cache: Map<string, FileCache>, |
| 457 | siteNode: Node, |
| 458 | edge: Edge |
| 459 | ): Promise<string> { |
| 460 | if (!edge.line || !supportsBranchGuards(siteNode.language)) return ''; |
| 461 | const file = loadFile(cg, projectRoot, cache, siteNode.filePath); |
| 462 | if (!file || file.drift || !file.abs) return ''; |
| 463 | const site = { line: edge.line, column: typeof edge.column === 'number' ? edge.column : null }; |
| 464 | const guards = await guardsForFile(file.abs, file.language as Language, [site]); |
| 465 | const g = guards.get(siteKey(site)); |
| 466 | return g ? guardLabel(g) : ''; |
| 467 | } |
| 468 | |
| 469 | // ============================================================================= |
| 470 | // Building the flows |
no test coverage detected