rust-lang / rustfmt

Format Rust code
https://rust-lang.github.io/rustfmt/
Apache License 2.0
6k stars 883 forks source link

let proc-macro's provide a formatting hook for rustfmt #5656

Open dvc94ch opened 1 year ago

dvc94ch commented 1 year ago

I'm building an app based on dioxus that uses the rsx! proc macro extensively. it's basically html with embedded rust closures. the rsx! macro even has an autoformatter [0] used by a vscode plugin. Since we can't run that in ci it would be really nice if we could somehow tell rustfmt how to format the code.

chipnertkj commented 1 month ago

I have opened a discussion thread in the Rust Internals Forum related to this issue. If there is something constructive you could add to the discussion (criticism, possible solutions, concerns, use cases), please head through the link below. https://internals.rust-lang.org/t/discussion-adding-grammar-information-to-procedural-macros-for-proper-custom-syntax-support-in-the-toolchain/21496