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

Is it possible to @suppress only a property's setter? #2158

Closed
agramian opened this issue Sep 21, 2021 · 2 comments · Fixed by #2220
Closed

Is it possible to @suppress only a property's setter? #2158

agramian opened this issue Sep 21, 2021 · 2 comments · Fixed by #2220
Labels
bug question A user question, can be resolved if the question is answered/resolved

Comments

@agramian
Copy link

Question

I would like to expose the getter and suppress the setter for a property in the generated documentation.
Below is the way I have attempted to achieve this but it doesn't seem to work.

    var property: Int
        /** @suppress */
        private set

Is it possible to hide/exclude only a property's setter while making its getter visible?

Installation

  • Operating system: Linux
  • Build tool: Gradle v6.7.1
  • Dokka version: 1.5
@agramian agramian added the question A user question, can be resolved if the question is answered/resolved label Sep 21, 2021
@MarcinAman
Copy link
Contributor

Why would you like to hide the setter? Dokka in the default html format doesn't render setters/getters until they are annotated with some documented annotations.

Also: in this case the setter is private so it really shouldn't be visible as by default we include only public api

@agramian
Copy link
Author

I would like to hide the setter because as you say it is private and shouldn't be visible to the public api.

I am using Dokka in the default html format as far as I can tell and it is rendering class properties with a separate getter and setter. There is no annotation I have added to the properties.

dokkaHtml {
    dokkaSourceSets {
        named("main") {
            noAndroidSdkLink.set(false)
            perPackageOption {
                matchingRegex.set("some_regex")
                suppress.set(true)
            }
        }
    }
}

Yes in the example I provided the setter is private and I am expecting it to be hidden as you are saying but it is shown.

Please let me know if there is any additional information that you need to help to understand/resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug question A user question, can be resolved if the question is answered/resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants