boolean (@NotNull GroovyPsiElement element) { final GrForStatement forStatement = PsiTreeUtil.getParentOfType(element, GrForStatement.class); if (forStatement == null) { return false; } final GrStatement body = forStatement.getBody(); return PsiTreeUtil.isAncestor(body, element, true); }