* 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)
| 1745 | * hop reads as "registered via onUpdate at App.tsx:3148", not a bare arrow. |
| 1746 | */ |
| 1747 | private synthEdgeNote(edge: Edge | null): { label: string; compact: string; registeredAt?: string } | null { |
| 1748 | if (!edge || edge.provenance !== 'heuristic') return null; |
| 1749 | const m = edge.metadata as Record<string, unknown> | undefined; |
| 1750 | const registeredAt = typeof m?.registeredAt === 'string' ? m.registeredAt : undefined; |
| 1751 | const at = registeredAt ? ` @${registeredAt}` : ''; |
| 1752 | if (m?.synthesizedBy === 'callback') { |
| 1753 | const via = m.via ? `\`${String(m.via)}\`` : 'a registrar'; |
| 1754 | const field = m.field ? ` on .${String(m.field)}` : ''; |
| 1755 | return { |
| 1756 | label: `callback — registered via ${via}${field} (dynamic dispatch)`, |
| 1757 | compact: `dynamic: callback via ${via}${at}`, |
| 1758 | registeredAt, |
| 1759 | }; |
| 1760 | } |
| 1761 | if (m?.synthesizedBy === 'event-emitter') { |
| 1762 | const ev = m.event ? `\`${String(m.event)}\`` : 'an event'; |
| 1763 | return { |
| 1764 | label: `event ${ev} — emit → handler (dynamic dispatch)`, |
| 1765 | compact: `dynamic: event ${ev}${at}`, |
| 1766 | registeredAt, |
| 1767 | }; |
| 1768 | } |
| 1769 | if (m?.synthesizedBy === 'react-render') { |
| 1770 | return { |
| 1771 | label: `React re-render — \`setState\` re-runs render() (dynamic dispatch)`, |
| 1772 | compact: `dynamic: React re-render via setState${at}`, |
| 1773 | registeredAt, |
| 1774 | }; |
| 1775 | } |
| 1776 | if (m?.synthesizedBy === 'jsx-render') { |
| 1777 | const child = m.via ? `<${String(m.via)}>` : 'a child component'; |
| 1778 | return { |
| 1779 | label: `renders ${child} (JSX child — dynamic dispatch)`, |
| 1780 | compact: `dynamic: renders ${child}`, |
| 1781 | registeredAt, |
| 1782 | }; |
| 1783 | } |
| 1784 | if (m?.synthesizedBy === 'vue-handler') { |
| 1785 | const ev = m.event ? `@${String(m.event)}` : 'a template event'; |
| 1786 | return { |
| 1787 | label: `Vue template handler — bound to ${ev} (dynamic dispatch)`, |
| 1788 | compact: `dynamic: Vue ${ev} handler`, |
| 1789 | registeredAt, |
| 1790 | }; |
| 1791 | } |
| 1792 | if (m?.synthesizedBy === 'interface-impl') { |
| 1793 | return { |
| 1794 | label: `interface/abstract dispatch — runs the implementation override (dynamic dispatch)`, |
| 1795 | compact: `dynamic: interface → impl${at}`, |
| 1796 | registeredAt, |
| 1797 | }; |
| 1798 | } |
| 1799 | if (m?.synthesizedBy === 'closure-collection') { |
| 1800 | const field = m.field ? `\`${String(m.field)}\`` : 'a collection'; |
| 1801 | return { |
| 1802 | label: `closure collection — runs handlers appended to ${field} (dynamic dispatch)`, |
| 1803 | compact: `dynamic: runs ${field} handlers${at}`, |
| 1804 | registeredAt, |
no outgoing calls
no test coverage detected