Be able to find annotated property accessor

#KT-37494 Fixed
This commit is contained in:
Vladimir Dolzhenko
2020-03-16 11:07:09 +00:00
parent 04ef1081b3
commit ce9297c5d6
3 changed files with 16 additions and 0 deletions
@@ -65,6 +65,10 @@ class KotlinAnnotatedElementsSearcher : QueryExecutor<PsiModifierListOwner, Anno
LightClassUtil.getLightClassPropertyMethods(declaration).all { consumer.process(it) }
}
is KtPropertyAccessor -> {
val method = LightClassUtil.getLightClassAccessorMethod(declaration)
return@processAnnotatedMembers consumer.process(method)
}
is KtParameter -> {
if (!declaration.toPsiParameters().all { consumer.process(it) }) return@processAnnotatedMembers false
LightClassUtil.getLightClassBackingField(declaration)?.let {
@@ -0,0 +1,7 @@
var name: String = ""
@java.lang.Deprecated
get() { TODO() }
set(value) { TODO() }
// ANNOTATION: java.lang.Deprecated
// SEARCH: method:getName
@@ -58,6 +58,11 @@ public class AnnotatedMembersSearchTestGenerated extends AbstractAnnotatedMember
runTest("idea/testData/search/annotations/testAnnotationsOnPropertiesAndParameters.kt");
}
@TestMetadata("testAnnotationsOnPropertyAccessor.kt")
public void testTestAnnotationsOnPropertyAccessor() throws Exception {
runTest("idea/testData/search/annotations/testAnnotationsOnPropertyAccessor.kt");
}
@TestMetadata("testAnnotationsWithParameters.kt")
public void testTestAnnotationsWithParameters() throws Exception {
runTest("idea/testData/search/annotations/testAnnotationsWithParameters.kt");