public static boolean mustAlign()

in src/java/org/jetbrains/plugins/clojure/formatter/ClojureBlockGenerator.java [66:108]


  public static boolean mustAlign(PsiElement blockPsi, PsiElement child, ClojureCodeStyleSettings settings) {

    if (blockPsi instanceof ClVector || blockPsi instanceof ClMap) {
      return !(child instanceof LeafPsiElement) || RIGHT_BRACES.contains(child.getNode().getElementType()) ||
          (child instanceof PsiComment);
    }

    if (blockPsi instanceof ClList &&
        !(blockPsi instanceof ClDef)) {
      final ClList list = (ClList) blockPsi;
      PsiElement first = list.getFirstNonLeafElement();

      if (settings.ALIGN_CLOJURE_FORMS || ClojurePsiCheckers.isImportMember(list)) {
        if (first == child && !applicationStart(first)) return true;
        if (first != null &&
            !applicationStart(first) &&
            first.getTextRange().getEndOffset() <= child.getTextRange().getStartOffset()) {
          return true;
        }
        final PsiElement second = list.getSecondNonLeafElement();
        if (second != null && child != null &&
            second.getTextRange().getEndOffset() <= child.getTextRange().getStartOffset()) {
          return true;
        }
      }
      // CLJ-98
      if (first instanceof ClKeyword && child != null &&
          first.getTextRange().getEndOffset() <= child.getTextRange().getStartOffset()) {
        return true;
      }
    }


    if (blockPsi instanceof ClLiteral) {
      ASTNode node = blockPsi.getNode();
      assert node != null;
      ASTNode[] elements = node.getChildren(null);
      if (elements.length > 0 && elements[0].getElementType() == ClojureTokenTypes.STRING_LITERAL) {
        return true;
      }
    }
    return false;
  }