I would like to create ScalaDoc entries to every val and def of my class. The problem is that the vals lie inside a pattern definition, and don't know how to use the /** */
syntax.
Example:
class C(id: String) {
val (part1, part2) = {
.....
(expr1, expr2)
}
}
How do I document part1 and part2?
I've read before asking this documentation about ScalaDoc.
It should be
val (
/** Part one. */
x,
/** Part two. */
y
) = (1, 2)
but for a flawed heuristic
/** To prevent doc comments attached to expressions from leaking out of scope
* onto the next documentable entity, they are discarded upon passing a right
* brace, bracket, or parenthesis.
*/
def discardDocBuffer(): Unit = ()
Under -Xlint
you will see
[warn] /home/apm/goofy/src/main/scala/docked.scala:10: discarding unmoored doc comment
[warn] /** Part two. */
[warn] ^
Maybe the heuristic could be improved to discard only if no doc is discovered on the enclosing entity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With