NimonSour / interthread

Apache License 2.0
14 stars 2 forks source link

feature idea : copy rust doc for methods #5

Closed michael-dm closed 8 months ago

michael-dm commented 8 months ago

I don't even know if it's possible but having the macro copy any documentation above methods to the ActorLive struct methods would be great.

PS : this lib is a gem !

NimonSour commented 8 months ago

Hi Michael!

Your mention of "documentation above methods" needs some clarification. My understanding is that you might be referring to the const or type declarations inside the impl block ? Please provide a minimal and simplified example of the case you're referring to, when possible, just to make sure we are on the same page.

Thank you for your involvement!

michael-dm commented 8 months ago

Sorry, I meant doc comments, like this :

/// Gives a friendly hello!
/// Says "Hello, [name](Person::name)" to the `Person` it is called on.
pub fn hello(&self) {
    println!("Hello, {}!", self.name);
}

Having these doc comments copied to the Live struct would be great for IDE hints and cargo doc generation. https://doc.rust-lang.org/rust-by-example/meta/doc.html

NimonSour commented 8 months ago

Absolutely, that's a good idea! It should definitely be implemented!

NimonSour commented 8 months ago

Appears to be working smoothly. Upgrade to version 1.2.3 in crates, already. I'll close the issue after a while, let's play with it first . Big question now is: To show the comments when editing or not to ? Anyway tanks for mentioning it !

michael-dm commented 8 months ago

Thanks a ton. It's working great !

NimonSour commented 8 months ago

Michael, thank you for this great suggestion !