[FIR] Add to new types of annotation predicates

- `ParentAnnotatedWith` matches declarations, which parent is annotated
- `HasAnnotatedWith` matches declarations, which have at least one
     direct child with annotation

Also, `DeclarationPredicate.Any` is removed, because there is no
  intention to support lookup for all declarations in module

^KT-52486 Fixed
This commit is contained in:
Dmitriy Novozhilov
2022-05-25 17:37:29 +03:00
committed by teamcity
parent c62257bbab
commit 23c69f8d17
15 changed files with 226 additions and 82 deletions
@@ -107,10 +107,6 @@ internal class LLFirIdePredicateBasedProvider(
"this method should never be called, but it was called with $predicate")
}
override fun visitAny(predicate: DeclarationPredicate.Any, data: FirDeclaration): Boolean {
return true
}
override fun visitAnd(predicate: DeclarationPredicate.And, data: FirDeclaration): Boolean {
return predicate.a.accept(this, data) && predicate.b.accept(this, data)
}