dokka icon indicating copy to clipboard operation
dokka copied to clipboard

Feature request: a way to suppress useless companion objects from javadoc

Open mikehearn opened this issue 8 years ago • 1 comments

Companion objects that consist of no fields and all @JvmStatic methods are effectively redundant, especially for Java users who will want to use static methods as normal. Currently these things clutter up the generated javadocs, making them ugly.

Whilst arguably the Kotlin compiler should optimise them out entirely in this case, that's a separate discussion (which I raised on youtrack). For now it'd be nice to recognise this pattern and suppress emission of references to the companions.

mikehearn avatar Aug 16 '17 15:08 mikehearn

Related: If I've got a companion object with a @JvmStatic method, in Javadoc I'd expect it to appear in the methods list for my containing class as a static method there.

Java programmers not (yet? 🤞) familiar with Kotlin are not going to know that they might need to go look at the Companion object.

And even as someone familiar w/ Kotlin, there's no way in the generated docs to see which of the companion methods have been marked as @JvmStatic so are callable via the root object.

NfNitLoop avatar Jul 20 '22 23:07 NfNitLoop