public void handleBlockComment(int commentIndex) { Token commentToken = this.tm.get(commentIndex); boolean isFirstColumn = handleWhitespaceAround(commentIndex); if (handleFormatOnOffTags(commentToken)) return; boolean isHeader = this.tm.isInHeader(commentIndex); boolean formattingEnabled = (this.options.comment_format_block_comment && !isHeader) || (this.options.comment_format_header && isHeader); formattingEnabled = formattingEnabled && this.tm.charAt(commentToken.originalStart + 2) != '-'; if (formattingEnabled && tokenizeMultilineComment(commentToken)) { this.commentStructure = commentToken.getInternalStructure(); this.ctm = new TokenManager(this.commentStructure, this.tm); handleStringLiterals(this.tm.toString(commentToken), commentToken.originalStart); addSubstituteWraps(); } else { commentToken.setInternalStructure(commentToLines(commentToken, -1)); } if (this.options.never_indent_block_comments_on_first_column && isFirstColumn) { commentToken.setIndent(0); commentToken.setWrapPolicy(null); } }
public void handleBlockComment(int commentIndex) { Token commentToken = this.tm.get(commentIndex); boolean isFirstColumn = handleWhitespaceAround(commentIndex); if (handleFormatOnOffTags(commentToken)) return; boolean isHeader = this.tm.isInHeader(commentIndex); boolean formattingEnabled = (this.options.comment_format_block_comment && !isHeader) || (this.options.comment_format_header && isHeader); formattingEnabled = formattingEnabled && this.tm.charAt(commentToken.originalStart + 2) != '-'; if (formattingEnabled && tokenizeMultilineComment(commentToken)) { this.commentStructure = commentToken.getInternalStructure(); this.ctm = new TokenManager(this.commentStructure, this.tm); handleStringLiterals(this.tm.toString(commentToken), commentToken.originalStart); addSubstituteWraps(); } else { commentToken.setInternalStructure(commentToLines(commentToken, -1)); } if (this.options.never_indent_block_comments_on_first_column && isFirstColumn) { commentToken.setIndent(0); commentToken.setWrapPolicy(WrapPolicy.FORCE_FIRST_COLUMN); } }
public void handleBlockComment(int commentIndex) { Token commentToken = this.tm.get(commentIndex); boolean isFirstColumn = handleWhitespaceAround(commentIndex); if (handleFormatOnOffTags(commentToken)) return; boolean isHeader = this.tm.isInHeader(commentIndex); boolean formattingEnabled = (this.options.comment_format_block_comment && !isHeader) || (this.options.comment_format_header && isHeader); formattingEnabled = formattingEnabled && this.tm.charAt(commentToken.originalStart + 2) != '-'; if (formattingEnabled && tokenizeMultilineComment(commentToken)) { this.commentStructure = commentToken.getInternalStructure(); this.ctm = new TokenManager(this.commentStructure, this.tm); handleStringLiterals(this.tm.toString(commentToken), commentToken.originalStart); addSubstituteWraps(); } else { commentToken.setInternalStructure(commentToLines(commentToken, -1)); } if (this.options.never_indent_block_comments_on_first_column && isFirstColumn) { commentToken.setIndent(0); commentToken.setWrapPolicy(WrapPolicy.FORCE_FIRST_COLUMN); } }
@Override public boolean visit(Javadoc node) { this.noFormatTagOpenStart = -1; this.formatCodeTagOpenEnd = -1; this.lastFormatCodeClosingTagIndex = -1; this.firstTagToken = null; this.ctm = null; int commentIndex = this.tm.firstIndexIn(node, TokenNameCOMMENT_JAVADOC); Token commentToken = this.tm.get(commentIndex); if (node.getParent() == null) { // not a proper javadoc, treat as block comment handleWhitespaceAround(commentIndex); } if (commentIndex < this.tm.size() - 1) commentToken.breakAfter(); if (handleFormatOnOffTags(commentToken)) return false; boolean isHeader = this.tm.isInHeader(commentIndex); boolean formattingEnabled = (this.options.comment_format_javadoc_comment && !isHeader) || (this.options.comment_format_header && isHeader); if (!formattingEnabled || !tokenizeMultilineComment(commentToken)) { commentToken.setInternalStructure(commentToLines(commentToken, -1)); return false; } this.commentStructure = commentToken.getInternalStructure(); this.commentIndent = this.tm.toIndent(commentToken.getIndent(), true); this.ctm = new TokenManager(commentToken.getInternalStructure(), this.tm); return true; }
@Override public boolean visit(Javadoc node) { this.noFormatTagOpenStart = -1; this.formatCodeTagOpenEnd = -1; this.lastFormatCodeClosingTagIndex = -1; this.firstTagToken = null; this.ctm = null; int commentIndex = this.tm.firstIndexIn(node, TokenNameCOMMENT_JAVADOC); Token commentToken = this.tm.get(commentIndex); if (node.getParent() == null) { // not a proper javadoc, treat as block comment handleWhitespaceAround(commentIndex); } if (commentIndex < this.tm.size() - 1) commentToken.breakAfter(); if (handleFormatOnOffTags(commentToken)) return false; boolean isHeader = this.tm.isInHeader(commentIndex); boolean formattingEnabled = (this.options.comment_format_javadoc_comment && !isHeader) || (this.options.comment_format_header && isHeader); if (!formattingEnabled || !tokenizeMultilineComment(commentToken)) { commentToken.setInternalStructure(commentToLines(commentToken, -1)); return false; } this.commentStructure = commentToken.getInternalStructure(); this.commentIndent = this.tm.toIndent(commentToken.getIndent(), true); this.ctm = new TokenManager(commentToken.getInternalStructure(), this.tm); return true; }
@Override public boolean visit(Javadoc node) { this.noFormatTagOpenStart = -1; this.formatCodeTagOpenEnd = -1; this.lastFormatCodeClosingTagIndex = -1; this.firstTagToken = null; this.ctm = null; int commentIndex = this.tm.firstIndexIn(node, TokenNameCOMMENT_JAVADOC); Token commentToken = this.tm.get(commentIndex); if (node.getParent() == null) { // not a proper javadoc, treat as block comment handleWhitespaceAround(commentIndex); } if (commentIndex < this.tm.size() - 1) commentToken.breakAfter(); if (handleFormatOnOffTags(commentToken)) return false; boolean isHeader = this.tm.isInHeader(commentIndex); boolean formattingEnabled = (this.options.comment_format_javadoc_comment && !isHeader) || (this.options.comment_format_header && isHeader); if (!formattingEnabled || !tokenizeMultilineComment(commentToken)) { commentToken.setInternalStructure(commentToLines(commentToken, -1)); return false; } this.commentStructure = commentToken.getInternalStructure(); this.commentIndent = this.tm.toIndent(commentToken.getIndent(), true); this.ctm = new TokenManager(commentToken.getInternalStructure(), this.tm); handleJavadocTagAlignment(node); return true; }
if (handleFormatOnOffTags(commentToken)) return;
if (handleFormatOnOffTags(commentToken)) return;
if (handleFormatOnOffTags(commentToken)) return;