boolean (@Nullable PsiElement element) { if (element == null) { return false; } if (element instanceof PsiWhiteSpace) { return element.textContains('\n'); } final ASTNode node = element.getNode(); if (node == null) { return false; } final CharSequence text = node.getChars(); boolean lineFeedFound = false; for (int i = 0; i < text.length(); i++) { final char c = text.charAt(i); if (!StringUtil.isWhiteSpace(c)) { return false; } lineFeedFound |= c == '\n'; } return lineFeedFound; }