@Nullable
  Indent computeBlockIndent(@NotNull ASTNode node) {
    if (node instanceof OuterLanguageElement) {
      Indent templateIndent = computeTemplateIndent(((OuterLanguageElement)node).getTextRange());
      if (templateIndent != null) return templateIndent;
    }
    IElementType nodeType = PsiUtilCore.getElementType(node);
    IElementType parentType = PsiUtilCore.getElementType(node.getTreeParent());
    IElementType grandParentType = parentType == null ? null : PsiUtilCore.getElementType(node.getTreeParent().getTreeParent());
    IElementType grand2ParentType = grandParentType == null ? null :
                                    PsiUtilCore.getElementType(node.getTreeParent().getTreeParent().getTreeParent());

    assert nodeType != YAMLElementTypes.SEQUENCE : "Sequence should be inlined!";
    assert nodeType != YAMLElementTypes.MAPPING : "Mapping should be inlined!";
    assert nodeType != YAMLElementTypes.DOCUMENT : "Document should be inlined!";

    if (YAMLElementTypes.DOCUMENT_BRACKETS.contains(nodeType)) {
      return SAME_AS_PARENT_INDENT;
    }
    else if (YAMLElementTypes.BRACKETS.contains(nodeType)) {
      return SAME_AS_INDENTED_ANCESTOR_INDENT;
    }
    else if (YAMLElementTypes.TEXT_SCALAR_ITEMS.contains(nodeType)) {
      if (grandParentType == YAMLElementTypes.DOCUMENT) {
        return SAME_AS_PARENT_INDENT;
      }
      if (grand2ParentType == YAMLElementTypes.ARRAY || grand2ParentType == YAMLElementTypes.HASH) {
        return Indent.getContinuationWithoutFirstIndent();
      }
      return DIRECT_NORMAL_INDENT;
    }
    else if (nodeType == YAMLParserDefinition.FILE) {
      return SAME_AS_PARENT_INDENT;
    }
    else if (YAMLElementTypes.SCALAR_VALUES.contains(nodeType)) {
      return DIRECT_NORMAL_INDENT;
    }
    else if (nodeType == YAMLElementTypes.SEQUENCE_ITEM) {
      return computeSequenceItemIndent(node);
    }
    else if (nodeType == YAMLElementTypes.KEY_VALUE_PAIR) {
      return computeKeyValuePairIndent(node);
    }
    else {
      if (nodeType == YAMLTokenTypes.COMMENT) {
        if (parentType == YAMLElementTypes.SEQUENCE) {
          return computeSequenceItemIndent(node);
        }
        if (parentType == YAMLElementTypes.MAPPING) {
          return computeKeyValuePairIndent(node);
        }
      }
      return YAMLElementTypes.TOP_LEVEL.contains(parentType) ? SAME_AS_PARENT_INDENT : null;
    }
  }
@Nullable
  Indent computeBlockIndent(@NotNull ASTNode node)