diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-08-20 13:59:58 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-08-20 15:36:07 +0200 |
commit | b9a1b3380a0bb8a64f3c7f257374cd4a6b2f3cfe (patch) | |
tree | 2417b1065167353cf09751ecd5d07d6f624bc4d8 /plugins | |
parent | fab2d4ba4f13454ab36ea7ee333579bf3441f2ed (diff) | |
download | dokka-b9a1b3380a0bb8a64f3c7f257374cd4a6b2f3cfe.tar.gz dokka-b9a1b3380a0bb8a64f3c7f257374cd4a6b2f3cfe.tar.bz2 dokka-b9a1b3380a0bb8a64f3c7f257374cd4a6b2f3cfe.zip |
Fix requested bugfixes
Diffstat (limited to 'plugins')
4 files changed, 9 insertions, 8 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt index 0defc69e..f934faa5 100644 --- a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt +++ b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt @@ -136,9 +136,11 @@ interface JvmSignatureUtils { || it.dri == DRI("java.lang", "Deprecated") } == true) setOf(TextStyle.Strikethrough) else emptySet() - infix fun DFunction.uses(t: DTypeParameter): Boolean = - t.dri in (listOfNotNull(receiver?.type?.drisOfAllNestedBounds, receiver?.dri) + + infix fun DFunction.uses(t: DTypeParameter): Boolean { + val allDris: List<DRI> = (listOfNotNull(receiver?.dri, *receiver?.type?.drisOfAllNestedBounds?.toTypedArray() ?: emptyArray()) + parameters.flatMap { listOf(it.dri) + it.type.drisOfAllNestedBounds }) + return t.dri in allDris + } } sealed class AtStrategy diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt index e8913922..68836b46 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt @@ -2,13 +2,12 @@ package org.jetbrains.dokka.javadoc.location import org.jetbrains.dokka.base.resolvers.local.DefaultLocationProvider import org.jetbrains.dokka.javadoc.pages.* -import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.links.* import org.jetbrains.dokka.links.Nullable -import org.jetbrains.dokka.links.PointingToDeclaration -import org.jetbrains.dokka.links.parent import org.jetbrains.dokka.model.* import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.model.DisplaySourceSet +import org.jetbrains.dokka.model.TypeConstructor import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext @@ -76,7 +75,7 @@ class JavadocLocationProvider(pageRoot: RootPageNode, dokkaContext: DokkaContext private fun getLocalLocation(dri: DRI, context: PageNode?): String? = nodeIndex[dri]?.let { resolve(it, context) } - ?: nodeIndex[dri.parent]?.takeIf { it is JavadocClasslikePageNode }?.let { + ?: nodeIndex[dri.parent]?.takeIf { dri.target !is PointingToGenericParameters && it is JavadocClasslikePageNode }?.let { val anchor = when (val anchorElement = (it as? JavadocClasslikePageNode)?.findAnchorableByDRI(dri)) { is JavadocFunctionNode -> anchorElement.getAnchor() is JavadocEntryNode -> anchorElement.name diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt index 30a9f764..2ae5302d 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt @@ -312,7 +312,7 @@ internal class JavadocClasslikeTemplateMapTest : AbstractJavadocTemplateMapTest( val ownMethods = assertIsInstance<List<*>>(methods["own"]).first() val sampleFunction = assertIsInstance<Map<String, Any?>>(ownMethods) - assertEquals("final <D extends <a href=Generic.html#Generic>T</a>> <a href=Generic.html#sampleFunction()>D</a> <a href=Generic.html#sampleFunction()>sampleFunction</a>()", sampleFunction.signatureWithModifiers()) + assertEquals("final <D extends <a href=Generic.html>T</a>> <a href=Generic.html#sampleFunction()>D</a> <a href=Generic.html#sampleFunction()>sampleFunction</a>()", sampleFunction.signatureWithModifiers()) } } diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt index cd0a8e8f..afea5914 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt @@ -110,7 +110,7 @@ class JavadocTest : AbstractCoreTest() { .firstChildOfType<JavadocClasslikePageNode> { it.name == "Test" } val testFunctionNode = testClassNode.methods.first { it.name == "test3" } assertEquals( - """<a href=Test.html#test3(A,T)>test3</a>(<a href=Test.html#Test>A</a> a, <a href=Test.html#test3(A,T)>T</a> t)""", + """<a href=Test.html#test3(A,T)>test3</a>(<a href=Test.html>A</a> a, <a href=Test.html#test3(A,T)>T</a> t)""", transformer.htmlForContentNode( testFunctionNode.signature.signatureWithoutModifiers, testClassNode |