1010import com .intellij .patterns .PsiElementPattern ;
1111import com .intellij .util .ProcessingContext ;
1212import org .jetbrains .annotations .NotNull ;
13- import org .jetbrains .kotlin .descriptors .annotations .AnnotationDescriptor ;
14- import org .jetbrains .kotlin .idea .caches .resolve .ResolutionUtils ;
15- import org .jetbrains .kotlin .name .FqName ;
1613import org .jetbrains .kotlin .psi .KtAnnotationEntry ;
17- import org .jetbrains .kotlin . resolve . BindingContext ;
18- import org .jetbrains .kotlin . resolve . lazy . BodyResolveMode ;
14+ import org .jetbrains .uast . UAnnotation ;
15+ import org .jetbrains .uast . UastContextKt ;
1916
2017/**
2118 * @author Filip Hrisafov
@@ -32,20 +29,12 @@ public KtAnnotationEntryPattern qName(ElementPattern<String> pattern) {
3229 return with ( new PatternCondition <KtAnnotationEntry >( "qName" ) {
3330 @ Override
3431 public boolean accepts (@ NotNull KtAnnotationEntry ktAnnotation , ProcessingContext context ) {
35- AnnotationDescriptor descriptor = ResolutionUtils .analyze (
36- ktAnnotation ,
37- BodyResolveMode .PARTIAL_FOR_COMPLETION
38- ).get ( BindingContext .ANNOTATION , ktAnnotation );
39-
40- if ( descriptor == null ) {
41- return false ;
42- }
43-
44- FqName fqName = descriptor .getFqName ();
45- if ( fqName == null ) {
32+ UAnnotation uElement = UastContextKt .toUElement ( ktAnnotation , UAnnotation .class );
33+ if ( uElement == null ) {
4634 return false ;
4735 }
48- return pattern .accepts ( fqName .asString (), context );
36+ String name = uElement .getQualifiedName ();
37+ return pattern .accepts ( name , context );
4938 }
5039 } );
5140 }
0 commit comments