boolean (PsiElement context) { PsiElement parent = context; while (parent != null) { if (parent instanceof PsiMember) { return ((PsiMember)parent).hasModifierProperty(PsiModifier.STATIC); } if (parent instanceof GroovyFile && parent.isPhysical()) return false; if (parent instanceof GrFunctionalExpression) return false; parent = parent.getContext(); } return false; }