Don't run another method reference search for constructors (KT-17751)
Constructors can't be used as properties and have no overrides.
This commit is contained in:
+6
-1
@@ -42,9 +42,14 @@ import org.jetbrains.kotlin.utils.ifEmpty
|
|||||||
|
|
||||||
class KotlinOverridingMethodReferenceSearcher : MethodUsagesSearcher() {
|
class KotlinOverridingMethodReferenceSearcher : MethodUsagesSearcher() {
|
||||||
override fun processQuery(p: MethodReferencesSearch.SearchParameters, consumer: Processor<PsiReference>) {
|
override fun processQuery(p: MethodReferencesSearch.SearchParameters, consumer: Processor<PsiReference>) {
|
||||||
|
val method = p.method
|
||||||
|
val isConstructor = p.project.runReadActionInSmartMode { method.isConstructor }
|
||||||
|
if (isConstructor) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
super.processQuery(p, consumer)
|
super.processQuery(p, consumer)
|
||||||
|
|
||||||
val method = p.method
|
|
||||||
p.project.runReadActionInSmartMode {
|
p.project.runReadActionInSmartMode {
|
||||||
val containingClass = method.containingClass ?: return@runReadActionInSmartMode
|
val containingClass = method.containingClass ?: return@runReadActionInSmartMode
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user