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

Add flag to hide all inherited members #1501

Closed
BarkingBad opened this issue Sep 22, 2020 · 14 comments · Fixed by #1814
Closed

Add flag to hide all inherited members #1501

BarkingBad opened this issue Sep 22, 2020 · 14 comments · Fixed by #1814
Labels
enhancement An issue for a feature or an overall improvement
Milestone

Comments

@BarkingBad
Copy link
Contributor

There should be possibility to hide all inherited (aka FAKE_OVERRIDEN) members of class

@BarkingBad BarkingBad added the enhancement An issue for a feature or an overall improvement label Sep 22, 2020
@prateem
Copy link

prateem commented Oct 20, 2020

Came here from this SO post.

Would love to see this make it through sometime soon. Thanks for the awesome tool!

@shipsywor
Copy link

Has this important issue addressed yet? Been 6 months! It makes dokka completely unusable for Android projects with hundred of functions inherited. The functions I defined in the class are impossible to find and very cluttered.

Details: #1780

@zsmb13
Copy link
Contributor

zsmb13 commented Mar 16, 2021

In our project, we ended up using the separateInheritedMembers option with some convoluted Gradle config, as seen here.

This puts all the inherited junk into a separate tab at least, see an example here

image

Only a solution for the HTML output, and not the best possible solution, but it's something.

@shipsywor
Copy link

shipsywor commented Mar 16, 2021

@zsmb13 Thank you! got it working.

Had to change configuration a little from your getstream example.

I had to use this for dokka v1.4.30


tasks.withType(dokkaHtml.getClass()).configureEach {
    pluginsMapConfiguration.set(
            ["org.jetbrains.dokka.base.DokkaBase": """{ "separateInheritedMembers": true}"""]
    )
}

But still hoping for more flexible solution by the dokka maintainers as it only works with HTML as you mentioned.

@zsmb13
Copy link
Contributor

zsmb13 commented Mar 16, 2021

Oh yes, the task to modify depends on whether you use multi module dokka or not, either dokkaHtml or dokkaHtmlPartial.

@kamildoleglo
Copy link
Contributor

This should be fixed in 1.4.30 I believe, could you check that in your projects please?

@kamildoleglo kamildoleglo added the awaiting response An issue/PR that cannot be completed without additional information or a discussion label Mar 16, 2021
@hpehl
Copy link

hpehl commented Mar 16, 2021

I can confirm that it is fixed now.

I mixed up issues. The comment above was meant for #1779

@shipsywor
Copy link

How does the v1.4.30 fixes it? How should we use the hide flag with respect to Android Gradle project? A small sample configuration here or on docs would be great to try it out.

@hpehl Can you please show how you tried that with example?

@kamildoleglo
Copy link
Contributor

kamildoleglo commented Mar 16, 2021

Fake overrides should be filtered out by default in 1.4.30, the hide flag is called suppressObviousFunctions I believe

@hpehl
Copy link

hpehl commented Mar 16, 2021

@shipsywor sorry I mixed up issues. When I claimed that is was fixed I was referring to #1779 not this issue.

@shipsywor
Copy link

shipsywor commented Mar 16, 2021

@kamildoleglo On Version 1.4.30, the result is still not as desired.

I have created a sample project here: https://github.com/shipsywor/dokka-android-kotlin-sample

As you stated, fake overrides should be filtered by default BUT they are not.

Everything except nice are inherited functions which should not have been shown be default as you mentioned.

output1

@MarcinAman
Copy link
Contributor

I think that there is a little bit of a confusion around what suppressObviousFunctions should do. The main idea was to hide obvious functions in dokka. That saying it is everything that is inherited from java.lang.Object or java.lang.Enum and in kotlin it is every function that is generated for case class (componentN, equals, hashCode etc) or inherited from Any or Enum.
It was not designed to handle this issue but as it turns out lots of people are interested in having such functionality in dokka, so i'll do my best to add it to next version ☺️

@MarcinAman MarcinAman removed the awaiting response An issue/PR that cannot be completed without additional information or a discussion label Mar 17, 2021
@MarcinAman MarcinAman added this to the 1.4.31 milestone Mar 17, 2021
@MarcinAman MarcinAman linked a pull request Mar 30, 2021 that will close this issue
@kabumere
Copy link

For whoever lands on this page in the future and would like to avoid the mini rabbit hole I went through:

The solution that the PR in late March introduced was to configure your dokka task to set suppressInheritedMembers to true (it is false by default).

@petruswrango
Copy link

Above discussion did not resolve it for me.
I should say that I'm using dokkaHtmlMultiModule, and not dokkaHtml.
What I ended up with was the the module's build.gradle.kts file:

tasks.dokkaHtmlPartial.configure {
    pluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> {
        separateInheritedMembers = true
    }
}

Using dokka version 1.6.10

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants