Don't process Java references twice when looking for kotlin overrides (KT-17751)

This commit is contained in:
Nikolay Krasko
2017-06-30 16:06:51 +03:00
parent 0cd8ee57b8
commit fe17d616b9
@@ -48,16 +48,19 @@ class KotlinOverridingMethodReferenceSearcher : MethodUsagesSearcher() {
return
}
super.processQuery(p, consumer)
val searchScope = p.project.runReadActionInSmartMode {
p.effectiveSearchScope
.intersectWith(method.useScope)
.restrictToKotlinSources()
}
if (searchScope === GlobalSearchScope.EMPTY_SCOPE) return
super.processQuery(MethodReferencesSearch.SearchParameters(method, searchScope, p.isStrictSignatureSearch, p.optimizer), consumer)
p.project.runReadActionInSmartMode {
val containingClass = method.containingClass ?: return@runReadActionInSmartMode
val searchScope = p.effectiveSearchScope
.intersectWith(method.useScope)
.restrictToKotlinSources()
if (searchScope === GlobalSearchScope.EMPTY_SCOPE) return@runReadActionInSmartMode
val nameCandidates = getPropertyNamesCandidatesByAccessorName(Name.identifier(method.name))
for (name in nameCandidates) {
p.optimizer.searchWord(