boolean (@NotNull PsiFile file, int offset) { if (!SourceTreeToPsiMap.hasTreeElement(file)) { return false; } CharSequence chars = file.getViewProvider().getContents(); int start = CharArrayUtil.shiftBackward(chars, offset - 1, " \t"); if (start > 0 && chars.charAt(start) != '\n' && chars.charAt(start) != '\r') { return false; } int end = CharArrayUtil.shiftForward(chars, offset, " \t"); if (end >= chars.length()) { return false; } ASTNode element = SourceTreeToPsiMap.psiElementToTree(CoreCodeStyleUtil.findElementInTreeWithFormatterEnabled(file, end)); if (element == null) { return false; } if (element.getElementType() == TokenType.WHITE_SPACE) { return false; } if (element.getElementType() == PlainTextTokenTypes.PLAIN_TEXT) { return false; } /* if( element.getElementType() instanceof IJspElementType ) { return false; } */ if (getSettings(file).getCommonSettings(file.getLanguage()).KEEP_FIRST_COLUMN_COMMENT && isCommentToken(element)) { if (IndentHelper.getInstance().getIndent(myProject, file.getFileType(), element, true) == 0) { return false; } } return true; }