Find Usages: Start read action for derived class search

#KT-11845 Fixed
This commit is contained in:
Alexey Sedunov
2016-04-18 15:45:57 +03:00
parent 39e6b893a7
commit df07554764
2 changed files with 15 additions and 12 deletions
+1
View File
@@ -25,6 +25,7 @@ Issues fixed:
- [KT-11659](https://youtrack.jetbrains.com/issue/KT-11659) Generate abstract overrides for Any members inside of Kotlin interfaces
- [KT-11866](https://youtrack.jetbrains.com/issue/KT-11866) Suggest "Create secondary constructor" when constructors exist but are not applicable
- [KT-11908](https://youtrack.jetbrains.com/issue/KT-11866) Allow properties with custom setters to be used in generated equals/hashCode/toString
- [KT-11845](https://youtrack.jetbrains.com/issue/KT-11845) Fixed exception on attempt to find derived classes
#### Debugger
@@ -76,20 +76,22 @@ class KotlinFindClassUsagesHandler(
fun processInheritors(): Boolean {
val request = HierarchySearchRequest(element, options.searchScope, options.isCheckDeepInheritance)
return request.searchInheritors().forEach(
PsiElementProcessorAdapter(
object : PsiElementProcessor<PsiClass> {
override fun execute(element: PsiClass): Boolean {
val isInterface = element.isInterface
return when {
isInterface && options.isDerivedInterfaces || !isInterface && options.isDerivedClasses ->
KotlinFindUsagesHandler.processUsage(processor, element.navigationElement)
else -> true
return runReadAction {
request.searchInheritors().forEach(
PsiElementProcessorAdapter(
object : PsiElementProcessor<PsiClass> {
override fun execute(element: PsiClass): Boolean {
val isInterface = element.isInterface
return when {
isInterface && options.isDerivedInterfaces || !isInterface && options.isDerivedClasses ->
KotlinFindUsagesHandler.processUsage(processor, element.navigationElement)
else -> true
}
}
}
}
)
)
)
)
}
}
val classOrObject = element as KtClassOrObject