DioxusLabs / dioxus

Fullstack GUI library for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
19.27k stars 733 forks source link

Autofmt nested rsx using syn::Visitor #2279

Closed jkelleyrtp closed 2 months ago

jkelleyrtp commented 2 months ago

I'm not an expert at using the visitor pattern so this is currently messy, but it implements nested rsx formatting by recursing using the visitor pattern, placing dummy tokens, expanding those using prettyplease, and then replacing those tokens with the formatted blocks.

All of it feels hacky but we have to work around the fact that prettyplease doesn't expose any of this machinery for us.

Fix #2205