boolean (final @NotNull PsiElement element) { if (element instanceof PsiWhiteSpace) { return false; } final CharSequence chars = element.getNode().getChars(); for (int i = 0; i < chars.length(); i++) { if (!Character.isWhitespace(chars.charAt(i))) { return true; } } return false; }