From 7201bcfca3b426d741c10d4c05201cb03e9f5d3c Mon Sep 17 00:00:00 2001 From: Błażej Kardyś Date: Fri, 20 Mar 2020 03:35:03 +0100 Subject: Fixing incorrect java supertypes DRIs --- .../kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'plugins/base/src/main/kotlin') diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 549e765f..35bbd05e 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -100,7 +100,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { val superMethods = mutableListOf() methods.forEach { superMethodsKeys.add(it.hash) } fun addAncestors(element: PsiClass) { - ancestorsSet.add(element.toDRI()) + ancestorsSet.add(DRI.from(element)) element.interfaces.forEach(::addAncestors) element.superClass?.let(::addAncestors) } @@ -290,7 +290,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { fun mapBounds(bounds: Array): List = if (bounds.isEmpty()) emptyList() else bounds.mapNotNull { (it as? PsiClassType)?.let { classType -> - Nullable(TypeConstructor(classType.resolve()!!.toDRI(), emptyList())) + Nullable(TypeConstructor(DRI.from(classType.resolve()!!), emptyList())) } } return typeParameters.mapIndexed { index, type -> @@ -304,9 +304,6 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { } } - private fun PsiQualifiedNamedElement.toDRI() = - DRI(qualifiedName.orEmpty().substringBeforeLast('.', ""), name) - private fun PsiMethod.getPropertyNameForFunction() = getAnnotation(DescriptorUtils.JVM_NAME.asString())?.findAttributeValue("name")?.text ?: when { -- cgit