* Describe a synthesized (dynamic-dispatch) edge for human output: how the * callback was wired up — the bridge static parsing can't see. Returns null * for ordinary static edges. Used by trace + the node trail so a synthesized * hop reads as "registered via onUpdate at App.tsx:3148", not a
(edge: Edge | null)
| 2447 | * hop reads as "registered via onUpdate at App.tsx:3148", not a bare arrow. |
| 2448 | */ |
| 2449 | private synthEdgeNote(edge: Edge | null): { label: string; compact: string; registeredAt?: string } | null { |
| 2450 | if (!edge || edge.provenance !== 'heuristic') return null; |
| 2451 | const m = edge.metadata as Record<string, unknown> | undefined; |
| 2452 | const registeredAt = typeof m?.registeredAt === 'string' ? m.registeredAt : undefined; |
| 2453 | const at = registeredAt ? ` @${registeredAt}` : ''; |
| 2454 | if (m?.synthesizedBy === 'callback') { |
| 2455 | const via = m.via ? `\`${String(m.via)}\`` : 'a registrar'; |
| 2456 | const field = m.field ? ` on .${String(m.field)}` : ''; |
| 2457 | return { |
| 2458 | label: `callback — registered via ${via}${field} (dynamic dispatch)`, |
| 2459 | compact: `dynamic: callback via ${via}${at}`, |
| 2460 | registeredAt, |
| 2461 | }; |
| 2462 | } |
| 2463 | if (m?.synthesizedBy === 'event-emitter') { |
| 2464 | const ev = m.event ? `\`${String(m.event)}\`` : 'an event'; |
| 2465 | return { |
| 2466 | label: `event ${ev} — emit → handler (dynamic dispatch)`, |
| 2467 | compact: `dynamic: event ${ev}${at}`, |
| 2468 | registeredAt, |
| 2469 | }; |
| 2470 | } |
| 2471 | if (m?.synthesizedBy === 'react-render') { |
| 2472 | return { |
| 2473 | label: `React re-render — \`setState\` re-runs render() (dynamic dispatch)`, |
| 2474 | compact: `dynamic: React re-render via setState${at}`, |
| 2475 | registeredAt, |
| 2476 | }; |
| 2477 | } |
| 2478 | if (m?.synthesizedBy === 'jsx-render') { |
| 2479 | const child = m.via ? `<${String(m.via)}>` : 'a child component'; |
| 2480 | return { |
| 2481 | label: `renders ${child} (JSX child — dynamic dispatch)`, |
| 2482 | compact: `dynamic: renders ${child}`, |
| 2483 | registeredAt, |
| 2484 | }; |
| 2485 | } |
| 2486 | if (m?.synthesizedBy === 'vue-handler') { |
| 2487 | const ev = m.event ? `@${String(m.event)}` : 'a template event'; |
| 2488 | return { |
| 2489 | label: `Vue template handler — bound to ${ev} (dynamic dispatch)`, |
| 2490 | compact: `dynamic: Vue ${ev} handler`, |
| 2491 | registeredAt, |
| 2492 | }; |
| 2493 | } |
| 2494 | if (m?.synthesizedBy === 'interface-impl') { |
| 2495 | return { |
| 2496 | label: `interface/abstract dispatch — runs the implementation override (dynamic dispatch)`, |
| 2497 | compact: `dynamic: interface → impl${at}`, |
| 2498 | registeredAt, |
| 2499 | }; |
| 2500 | } |
| 2501 | if (m?.synthesizedBy === 'closure-collection') { |
| 2502 | const field = m.field ? `\`${String(m.field)}\`` : 'a collection'; |
| 2503 | return { |
| 2504 | label: `closure collection — runs handlers appended to ${field} (dynamic dispatch)`, |
| 2505 | compact: `dynamic: runs ${field} handlers${at}`, |
| 2506 | registeredAt, |
no outgoing calls
no test coverage detected