Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for syn::custom_keyword? #35

Closed
kennykerr opened this issue Mar 6, 2023 · 3 comments
Closed

Support for syn::custom_keyword? #35

kennykerr opened this issue Mar 6, 2023 · 3 comments

Comments

@kennykerr
Copy link

Maybe I missed it, but I don't see an obvious way to support custom keywords since the crate's only public function expects a syn::File?

Any chance this is possible? Many thanks.

@dtolnay
Copy link
Owner

dtolnay commented Mar 6, 2023

I don't understand what this means. Could you clarify?

@kennykerr
Copy link
Author

I have my own custom Rust-like syntax that depends on syn::custom_keyword for parsing with the syn crate and I'd like to offer the ability to format these Rust-like source files with prettyplease since its mostly just Rust with the addition of a handful of custom keywords.

Right now, I'm having to escape the custom keywords, call rustfmt, and then unescape the result. I figure prettyplease would be less brittle if it supported custom keywords.

@dtolnay
Copy link
Owner

dtolnay commented Mar 6, 2023

Got it. I'd prefer to keep this crate just for formatting syn::File.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants