boolean (boolean classLevel, PsiElement psi) { if (psi instanceof PsiComment) { PsiElement prev = psi.getPrevSibling(); if (prev != null) { if (!classLevel || !PsiUtil.isNewLine(prev) || !fieldGroupEnded(psi)) { return true; } } } if (psi.getParent() instanceof GrLabeledStatement) { if (psi instanceof GrLiteral && GrStringUtil.isStringLiteral((GrLiteral)psi) //skip string comments at the beginning of spock table || !(psi instanceof GrStatement)) { return true; } } return false; }