use of org.jetbrains.plugins.groovy.annotator.GrRemoveAnnotationIntention in project intellij-community by JetBrains.
the class AnnotationChecker method checkApplicability.
public void checkApplicability(@NotNull GrAnnotation annotation, @Nullable PsiAnnotationOwner owner) {
final GrCodeReferenceElement ref = annotation.getClassReference();
final PsiElement resolved = ref.resolve();
if (resolved == null)
return;
assert resolved instanceof PsiClass;
PsiClass anno = (PsiClass) resolved;
String qname = anno.getQualifiedName();
if (!anno.isAnnotationType() && GrAnnotationCollector.findAnnotationCollector(anno) == null) {
if (qname != null) {
myHolder.createErrorAnnotation(ref, GroovyBundle.message("class.is.not.annotation", qname));
}
return;
}
for (CustomAnnotationChecker checker : CustomAnnotationChecker.EP_NAME.getExtensions()) {
if (checker.checkApplicability(myHolder, annotation))
return;
}
String description = CustomAnnotationChecker.isAnnotationApplicable(annotation, owner);
if (description != null) {
myHolder.createErrorAnnotation(ref, description).registerFix(new GrRemoveAnnotationIntention());
}
}
Aggregations