tokio-rs / valuable

MIT License
185 stars 19 forks source link

Feature request: Expose doc comments for struct/enum/field definitions #103

Open norcalli opened 2 years ago

norcalli commented 2 years ago

Given that a big usecase is for generating UIs, the natural usecase for a doc comment is to act as a tooltip. It's surprisingly hard to find any derive macro that exposes doc comments, so I'm wondering if it's possible to do or add here. Maybe there's some limitation that makes it impossible I'm not aware of?

nhawkes commented 1 year ago

+1 for wanting this feature

I know clap does this (https://github.com/clap-rs/clap/blob/master/clap_derive/src/utils/doc_comments.rs#L8) so I presume the same approach could be taken here