It would be nice if we could copy documentation fr...
# language-proposals
n
It would be nice if we could copy documentation from another method:
Copy code
/** 
  * @copy Foo.bar()
  */
For methods that do almost identical things but take slightly different parameters. For different params, a
@param
tag on the method would override whatever is present on the comment being copied from
👍 7
m
Strictly speaking, this isn't a language suggestion, but rather a feature request for #dokka, right?
1
n
That's a good question, and I'm not sure. I think Dokka is more of the entire engine that is responsible for generating a website for documentation. The
@copy
would also show up in IDEs, for example, so it feels lower in scope
m
I guess it comes down to whether the Kotlin compiler does anything with the comments or not. If the compiler doesn't do anything with it, then I don't think it's part of the language. There's very little discussion of comments in the docs that I can find. https://kotlinlang.org/docs/reference/coding-conventions.html#documentation-comments. It's all here, and referred to as KDoc, so I wouldn't consider it as part of the language per se. https://kotlinlang.org/docs/reference/kotlin-doc.html#documenting-kotlin-code But as you say, it's a very fine line here, so it may qualify as both.
1