Call Hierarchy: Show Kotlin usages of Java methods

#KT-12398 Fixed
This commit is contained in:
Alexey Sedunov
2016-09-30 21:00:51 +03:00
parent 5bb035282f
commit 3f6e60fb51
12 changed files with 133 additions and 23 deletions
@@ -45,7 +45,7 @@ fun KtFile.findFacadeClass(): KtLightClass? {
.firstOrNull { it is KtLightClassForFacade && this in it.files } as? KtLightClass
}
fun KtDeclaration.toLightElements(): List<PsiNamedElement> =
fun KtElement.toLightElements(): List<PsiNamedElement> =
when (this) {
is KtClassOrObject -> toLightClass().singletonOrEmptyList()
is KtNamedFunction,
@@ -60,6 +60,7 @@ fun KtDeclaration.toLightElements(): List<PsiNamedElement> =
elements
}
is KtTypeParameter -> toPsiTypeParameters()
is KtFile -> findFacadeClass().singletonOrEmptyList()
else -> listOf()
}