In my example the closure is the return value. But what if the closure is not a return value (e.g a local variable) ?
What I want is a tool that is able to extract closure's documentation/annotation from code (and may generate documentation with those data). Even if it's possible, it's useless in real cases but that was the idea :-)
Of course this can always be directly written in the parent's documentation (e.g using @return in my example). And that's the way it should be done (and moving the closure somewhere else means moving the comments also).
Because seperating closure's annotation but generating it in it's closest parent's documentation makes no sense in real cases (i.e the goal is to write doc not to complicated it).
There's a similar situation with Java and anonymous inner class (their doc comments are simply ignored and no one can extract them).
Anyway I would be pleased if a tool does parse the code and tells me : "Hey here's your function description. See here are some description about some closure I've found in it".
Regards,