boolean (Object element, PsiElement context) { PsiVariable variable; if (element instanceof PsiField field) { if (!field.hasModifierProperty(PsiModifier.FINAL) || !field.hasModifierProperty(PsiModifier.STATIC) || !JavaResolveUtil.isAccessible(field, field.getContainingClass(), field.getModifierList(), context, null, null)) { return false; } PsiClass aClass = PsiUtil.resolveClassInClassTypeOnly(field.getType()); if (aClass != null && aClass.isEnum()) { return false; } variable = field; } else if (element instanceof PsiLocalVariable local) { if (!local.hasModifierProperty(PsiModifier.FINAL)) { return false; } variable = local; } else { return false; } return TypeConversionUtil.isAssignable(selectorType, variable.getType()); }