From 54df62709a37fc8f55bded26fd5db15f9eb0fd25 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Tue, 18 Aug 2020 13:18:22 +0200 Subject: Hide unused generic type variables in constructor --- .../jetbrains/dokka/javadoc/signatures/JavadocSignatureProvider.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/javadoc') diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/signatures/JavadocSignatureProvider.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/signatures/JavadocSignatureProvider.kt index cda7345a..96616794 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/signatures/JavadocSignatureProvider.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/signatures/JavadocSignatureProvider.kt @@ -95,7 +95,8 @@ class JavadocSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLo modifiers { text(f.modifier[it]?.takeIf { it !in ignoredModifiers }?.name?.plus(" ") ?: "") text(f.modifiers()[it]?.toSignatureString() ?: "") - list(f.generics, prefix = "<", suffix = "> ") { + val usedGenerics = f.generics.filter { f uses it } + list(usedGenerics, prefix = "<", suffix = "> ") { +buildSignature(it) } signatureForProjection(f.type) @@ -184,7 +185,7 @@ class JavadocSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLo } private fun PageContentBuilder.DocumentableContentBuilder.signatureForProjection(p: Projection): Unit = when (p) { - is TypeParameter -> link(p.name, p.declarationDRI) + is TypeParameter -> link(p.name, p.dri) is TypeConstructor -> group { link(p.dri.classNames.orEmpty(), p.dri) list(p.projections, prefix = "<", suffix = ">") { -- cgit