From 571b424b33fd21647392f2fe9f2b6be00383f463 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 12 Jan 2018 17:31:32 +0100 Subject: [PATCH] Use DescriptorToSourceUtilsIde.getAnyDeclaration in super navigation #KT-16333 Fixed --- .../kotlin/idea/codeInsight/GotoSuperActionHandler.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/codeInsight/GotoSuperActionHandler.kt b/idea/src/org/jetbrains/kotlin/idea/codeInsight/GotoSuperActionHandler.kt index 3c794f7ce98..a7791d88835 100644 --- a/idea/src/org/jetbrains/kotlin/idea/codeInsight/GotoSuperActionHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/codeInsight/GotoSuperActionHandler.kt @@ -23,7 +23,6 @@ import org.jetbrains.kotlin.idea.KotlinBundle import org.jetbrains.kotlin.idea.caches.resolve.unsafeResolveToDescriptor import org.jetbrains.kotlin.idea.core.getDirectlyOverriddenDeclarations import org.jetbrains.kotlin.psi.* -import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode class GotoSuperActionHandler : CodeInsightActionHandler { @@ -42,7 +41,7 @@ class GotoSuperActionHandler : CodeInsightActionHandler { val descriptor = declaration.unsafeResolveToDescriptor(BodyResolveMode.PARTIAL) - val superDeclarations = findSuperDeclarations(descriptor) + val superDeclarations = findSuperDeclarations(project, descriptor) if (superDeclarations == null || superDeclarations.isEmpty()) return if (superDeclarations.size == 1) { @@ -72,7 +71,7 @@ class GotoSuperActionHandler : CodeInsightActionHandler { else -> null } - private fun findSuperDeclarations(descriptor: DeclarationDescriptor): List? { + private fun findSuperDeclarations(project: Project, descriptor: DeclarationDescriptor): List? { val superDescriptors: Collection = when (descriptor) { is ClassDescriptor -> { val supertypes = descriptor.typeConstructor.supertypes @@ -90,7 +89,7 @@ class GotoSuperActionHandler : CodeInsightActionHandler { if (descriptor is ClassDescriptor && isAny(descriptor)) { null } else - DescriptorToSourceUtils.descriptorToDeclaration(descriptor) + DescriptorToSourceUtilsIde.getAnyDeclaration(project, descriptor) } }