File tree 2 files changed +7
-2
lines changed
compiler/light-classes/src/org/jetbrains/kotlin/asJava
idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -124,13 +124,18 @@ object LightClassUtil {
124
124
return getPsiMethodWrappers(function).toList()
125
125
}
126
126
127
+ fun getLightClassMethodsByName (function : KtFunction , name : String ): Sequence <KtLightMethod > {
128
+ return getPsiMethodWrappers(function, name)
129
+ }
130
+
127
131
private fun getPsiMethodWrapper (declaration : KtDeclaration ): PsiMethod ? {
128
132
return getPsiMethodWrappers(declaration).firstOrNull()
129
133
}
130
134
131
- private fun getPsiMethodWrappers (declaration : KtDeclaration ): Sequence <KtLightMethod > =
135
+ private fun getPsiMethodWrappers (declaration : KtDeclaration , name : String? = null ): Sequence <KtLightMethod > =
132
136
getWrappingClasses(declaration).flatMap { it.methods.asSequence() }
133
137
.filterIsInstance<KtLightMethod >()
138
+ .filter { name == null || name == it.name }
134
139
.filter { it.kotlinOrigin == = declaration || it.navigationElement == = declaration }
135
140
136
141
private fun getWrappingClass (declaration : KtDeclaration ): PsiClass ? {
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ class KotlinShortNamesCache(private val project: Project) : PsiShortNamesCache()
192
192
filter,
193
193
KtNamedFunction ::class .java
194
194
) { ktNamedFunction ->
195
- val methods = LightClassUtil .getLightClassMethods (ktNamedFunction).filter { it. name == name }
195
+ val methods = LightClassUtil .getLightClassMethodsByName (ktNamedFunction, name)
196
196
return @processElements methods.all { method ->
197
197
processor.process(method)
198
198
}
You can’t perform that action at this time.
0 commit comments