* 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)
| 1852 | * hop reads as "registered via onUpdate at App.tsx:3148", not a bare arrow. |
| 1853 | */ |
| 1854 | private synthEdgeNote(edge: Edge | null): { label: string; compact: string; registeredAt?: string } | null { |
| 1855 | if (!edge || edge.provenance !== 'heuristic') return null; |
| 1856 | const m = edge.metadata as Record<string, unknown> | undefined; |
| 1857 | const registeredAt = typeof m?.registeredAt === 'string' ? m.registeredAt : undefined; |
| 1858 | const at = registeredAt ? ` @${registeredAt}` : ''; |
| 1859 | if (m?.synthesizedBy === 'callback') { |
| 1860 | const via = m.via ? `\`${String(m.via)}\`` : 'a registrar'; |
| 1861 | const field = m.field ? ` on .${String(m.field)}` : ''; |
| 1862 | return { |
| 1863 | label: `callback — registered via ${via}${field} (dynamic dispatch)`, |
| 1864 | compact: `dynamic: callback via ${via}${at}`, |
| 1865 | registeredAt, |
| 1866 | }; |
| 1867 | } |
| 1868 | if (m?.synthesizedBy === 'event-emitter') { |
| 1869 | const ev = m.event ? `\`${String(m.event)}\`` : 'an event'; |
| 1870 | return { |
| 1871 | label: `event ${ev} — emit → handler (dynamic dispatch)`, |
| 1872 | compact: `dynamic: event ${ev}${at}`, |
| 1873 | registeredAt, |
| 1874 | }; |
| 1875 | } |
| 1876 | if (m?.synthesizedBy === 'react-render') { |
| 1877 | return { |
| 1878 | label: `React re-render — \`setState\` re-runs render() (dynamic dispatch)`, |
| 1879 | compact: `dynamic: React re-render via setState${at}`, |
| 1880 | registeredAt, |
| 1881 | }; |
| 1882 | } |
| 1883 | if (m?.synthesizedBy === 'jsx-render') { |
| 1884 | const child = m.via ? `<${String(m.via)}>` : 'a child component'; |
| 1885 | return { |
| 1886 | label: `renders ${child} (JSX child — dynamic dispatch)`, |
| 1887 | compact: `dynamic: renders ${child}`, |
| 1888 | registeredAt, |
| 1889 | }; |
| 1890 | } |
| 1891 | if (m?.synthesizedBy === 'vue-handler') { |
| 1892 | const ev = m.event ? `@${String(m.event)}` : 'a template event'; |
| 1893 | return { |
| 1894 | label: `Vue template handler — bound to ${ev} (dynamic dispatch)`, |
| 1895 | compact: `dynamic: Vue ${ev} handler`, |
| 1896 | registeredAt, |
| 1897 | }; |
| 1898 | } |
| 1899 | if (m?.synthesizedBy === 'interface-impl') { |
| 1900 | return { |
| 1901 | label: `interface/abstract dispatch — runs the implementation override (dynamic dispatch)`, |
| 1902 | compact: `dynamic: interface → impl${at}`, |
| 1903 | registeredAt, |
| 1904 | }; |
| 1905 | } |
| 1906 | if (m?.synthesizedBy === 'closure-collection') { |
| 1907 | const field = m.field ? `\`${String(m.field)}\`` : 'a collection'; |
| 1908 | return { |
| 1909 | label: `closure collection — runs handlers appended to ${field} (dynamic dispatch)`, |
| 1910 | compact: `dynamic: runs ${field} handlers${at}`, |
| 1911 | registeredAt, |
no outgoing calls
no test coverage detected