Check the backing field before checking accessors in KotlinAnnotatedElementsSearcher. This should be faster, and it fixes the problem with IDEA hangs in DataBinding.

This commit is contained in:
Yan Zhulanow
2016-12-29 19:15:28 +03:00
committed by Yan Zhulanow
parent e775cc697e
commit 433dfdd1e8
@@ -55,9 +55,12 @@ class KotlinAnnotatedElementsSearcher : QueryExecutor<PsiModifierListOwner, Anno
consumer.process(wrappedMethod)
}
is KtProperty -> {
with (LightClassUtil.getLightClassPropertyMethods(declaration)) {
if (backingField != null) consumer.process(backingField) else all { consumer.process(it) }
val backingField = LightClassUtil.getLightClassBackingField(declaration)
if (backingField != null) {
return@processAnnotatedMembers consumer.process(backingField)
}
LightClassUtil.getLightClassPropertyMethods(declaration).all { consumer.process(it) }
}
else -> true
}