Add missing read action

This commit is contained in:
Dmitry Jemerov
2017-10-06 19:48:47 +02:00
parent 6c7f558d36
commit dc7ffdcbe4
@@ -140,12 +140,14 @@ class KotlinDefinitionsSearcher : QueryExecutor<PsiElement, DefinitionsScopedSea
for (implementation in implementations) { for (implementation in implementations) {
if (isDelegated(implementation)) continue if (isDelegated(implementation)) continue
val elementToProcess = runReadAction {
val mirrorElement = (implementation as? KtLightMethod)?.kotlinOrigin val mirrorElement = (implementation as? KtLightMethod)?.kotlinOrigin
val elementToProcess = when(mirrorElement) { when (mirrorElement) {
is KtProperty, is KtParameter -> mirrorElement is KtProperty, is KtParameter -> mirrorElement
is KtPropertyAccessor -> if (mirrorElement.parent is KtProperty) mirrorElement.parent else implementation is KtPropertyAccessor -> if (mirrorElement.parent is KtProperty) mirrorElement.parent else implementation
else -> implementation else -> implementation
} }
}
if (!consumer.process(elementToProcess)) { if (!consumer.process(elementToProcess)) {
return false return false