boolean (PsiElement element) { if (!(element instanceof PsiComment comment)) { return false; } if (element instanceof PsiDocComment) { return false; } final IElementType type = comment.getTokenType(); if (!JavaTokenType.C_STYLE_COMMENT.equals(type)) { return false; } final PsiElement sibling = PsiTreeUtil.nextLeaf(comment); if (!(sibling instanceof PsiWhiteSpace)) { return false; } final String whitespaceText = sibling.getText(); return whitespaceText.indexOf('\n') >= 0 || whitespaceText.indexOf('\r') >= 0; }