if (isSingleLine(psi, document)) {
return;
}
if (HbTokenTypes.COMMENT == psi.getNode().getElementType()) {
ASTNode commentNode = psi.getNode();
String commentText = commentNode.getText();
// comment might be unclosed or too short (a one character fold triggers an invalid range assertion error),
// so do a bit of sanity checking on its length and whether or not it's got the requisite open/close
// tags before we allow folding
if (commentText.length() > 6
&& commentText.substring(0, 3).equals("{{!")
&& commentText.substring(commentText.length() - 2, commentText.length()).equals("}}")) {
TextRange range = new TextRange(commentNode.getTextRange().getStartOffset() + 3, commentNode.getTextRange().getEndOffset() - 2);
descriptors.add(new FoldingDescriptor(commentNode, range));
}
}
if (psi instanceof HbBlockWrapper) {