diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-08-19 12:57:38 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-08-20 15:36:07 +0200 |
commit | 45bec5b68c2da35860877c6298bff04a4cb3d1d6 (patch) | |
tree | d99b27e6c6100ef93c2989caac66b55ef3ba3e21 /kotlin-analysis/src/main/kotlin | |
parent | e4fc2c274fd982b2742eac46581b504b56b2b48f (diff) | |
download | dokka-45bec5b68c2da35860877c6298bff04a4cb3d1d6.tar.gz dokka-45bec5b68c2da35860877c6298bff04a4cb3d1d6.tar.bz2 dokka-45bec5b68c2da35860877c6298bff04a4cb3d1d6.zip |
Fix LinkProvider to link properly all nested generic parameters
Diffstat (limited to 'kotlin-analysis/src/main/kotlin')
-rw-r--r-- | kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DRIFactory.kt | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DRIFactory.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DRIFactory.kt index 513817f3..217a3b7d 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DRIFactory.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DRIFactory.kt @@ -1,9 +1,6 @@ package org.jetbrains.dokka.analysis -import com.intellij.psi.PsiClass -import com.intellij.psi.PsiElement -import com.intellij.psi.PsiField -import com.intellij.psi.PsiMethod +import com.intellij.psi.* import org.jetbrains.dokka.links.Callable import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.DriTarget @@ -28,7 +25,7 @@ fun DRI.Companion.from(descriptor: DeclarationDescriptor) = descriptor.parentsWi fun DRI.Companion.from(psi: PsiElement) = psi.parentsWithSelf.run { val psiMethod = firstIsInstanceOrNull<PsiMethod>() val psiField = firstIsInstanceOrNull<PsiField>() - val classes = filterIsInstance<PsiClass>().toList() + val classes = filterIsInstance<PsiClass>().filterNot { it is PsiTypeParameter }.toList() // We only want exact PsiClass types, not PsiTypeParameter subtype DRI( classes.lastOrNull()?.qualifiedName?.substringBeforeLast('.', ""), classes.toList().takeIf { it.isNotEmpty() }?.asReversed()?.mapNotNull { it.name }?.joinToString("."), |