aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src')
-rw-r--r--plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt7
-rw-r--r--plugins/base/src/test/kotlin/model/JavaTest.kt4
2 files changed, 4 insertions, 7 deletions
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<PsiMethod>()
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<JvmReferenceType>): List<Bound> =
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 {
diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt
index 9bbfc929..2545823b 100644
--- a/plugins/base/src/test/kotlin/model/JavaTest.kt
+++ b/plugins/base/src/test/kotlin/model/JavaTest.kt
@@ -407,8 +407,8 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") {
"""
) {
with((this / "java" / "InheritorLinks").cast<DClass>()) {
- val dri = (this / "Foo").assertNotNull("Foo dri").dri
- with((this / "Bar").cast<DClass>()) {
+ val dri = (this / "Bar").assertNotNull("Foo dri").dri
+ with((this / "Foo").cast<DClass>()) {
with(extra[InheritorsInfo].assertNotNull("InheritorsInfo")) {
with(value.map.values.flatten().distinct()) {
this counts 1