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

SuppressedByConditionDocumentableFilterTransformer cannot suppress packages #2206

Closed
owengray-google opened this issue Oct 27, 2021 · 0 comments · Fixed by #2209
Closed

SuppressedByConditionDocumentableFilterTransformer cannot suppress packages #2206

owengray-google opened this issue Oct 27, 2021 · 0 comments · Fixed by #2209
Labels
bug feedback: Google An issue/PR submitted by colleagues at Google, most likely related to the Android API reference docs

Comments

@owengray-google
Copy link
Contributor

Package-level @hides are common in java source--we have many of them in the Android codebase.

We implement @hide with Marcin's plugin:

class HideTagDocumentableFilter(val dokkaContext: DokkaContext) :
    SuppressedByConditionDocumentableFilterTransformer(dokkaContext) {
    override fun shouldBeSuppressed(d: Documentable): Boolean =
        d.documentation.any {
            (_, docs) -> docs.dfs { it is CustomTagWrapper && it.name.trim() == "hide" } != null
        }
}

However, SuppressedByConditionDocumentableFilterTransformer has

    private fun processClassLike(classlike: DClasslike): DocumentableWithChanges<DClasslike> {
        if (shouldBeSuppressed(classlike)) return DocumentableWithChanges.filteredDocumentable()

But no such clause in private fun processPackage(dPackage: DPackage): DocumentableWithChanges<DPackage> {, which prevents package-level @hides from being processed. (The dPackage has the tag generated and accessible and should work fine.)

This should be a simple one-line change.
I can put up a PR for this if necessary.

Dokka version: 1.6.0-dev-122

@vmishenev vmishenev added the feedback: Google An issue/PR submitted by colleagues at Google, most likely related to the Android API reference docs label Oct 27, 2021
@vmishenev vmishenev linked a pull request Oct 27, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feedback: Google An issue/PR submitted by colleagues at Google, most likely related to the Android API reference docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants