boolean (final @NotNull T t, final ProcessingContext context) { final PsiReference[] references = t.getReferences(); for (final PsiReference reference : references) { if (targetPattern.accepts(reference.resolve(), context)) return true; if (reference instanceof PsiPolyVariantReference) { for (final ResolveResult result : ((PsiPolyVariantReference)reference).multiResolve(true)) { if (targetPattern.accepts(result.getElement(), context)) return true; } } } return false; }