-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Port over doc comments in route macros. #2022
Port over doc comments in route macros. #2022
Conversation
This allows documentation on the functions to appear in the generated docs, e.g.: ```rust /// The index page async fn index() -> &'static str { "Hello!" } ```
Does this handle multi line doc-comments? I don't recall if they're converted to one doc attribute with line breaks or multiple doc attrs. |
These are converted into multiple attributes, and so we need to store them all.
Huh, you're right, had no idea that is multi line comments worked. I've pushed a fix and manually tested. Tangentially, I am wondering whether it'd be better to just copy all attributes over? It's probably not that useful, but would mean e.g. that people could have manually added |
I'm apprehensive about that because it may seem strange that attributes meant for functions will not work on the generated struct. If you don't feel strongly that it should be done I'd like to wait until it is raised specifically. |
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
Thank you both, my proc macro foo is still quite weak ❤️ |
PR Type
Bug Fix / Feature
PR Checklist
Overview
This allows documentation on the functions to appear in the generated
docs, e.g.:
Closes #1389
I'm afraid I have no idea how to add tests for this beyond making sure this doesn't break when using docstrings.