Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mikehearn opened this issue Aug 16, 2017 · 1 comment · Fixed by #2681
Closed

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

mikehearn opened this issue Aug 16, 2017 · 1 comment · Fixed by #2681
Labels
enhancement An issue for a feature or an overall improvement format: Javadoc An issue/PR related to Dokka's Javadoc output format or the Javadoc comments in general plugin: kotlin-as-java An issue/PR related to Dokka's kotlin-as-java plugin

Comments

@mikehearn
Copy link
Contributor

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.

@semoro semoro added the enhancement An issue for a feature or an overall improvement label May 16, 2018
@Kordyjan Kordyjan added this to the Stable milestone Sep 1, 2020
@yalishevant yalishevant added the format: Javadoc An issue/PR related to Dokka's Javadoc output format or the Javadoc comments in general label Apr 5, 2022
@yalishevant yalishevant removed this from the Backlog Stable milestone Apr 5, 2022
@yalishevant yalishevant added the plugin: kotlin-as-java An issue/PR related to Dokka's kotlin-as-java plugin label Apr 5, 2022
@NfNitLoop
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An issue for a feature or an overall improvement format: Javadoc An issue/PR related to Dokka's Javadoc output format or the Javadoc comments in general plugin: kotlin-as-java An issue/PR related to Dokka's kotlin-as-java plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants