@Override
    protected void visitNode(TreeElement root) {
      if (!shouldShowNode(root)) {
        indent += 2;
        return;
      }

      StringUtil.repeatSymbol(buffer, ' ', indent);
      try {
        if (root instanceof CompositeElement) {
          if (usePsi) {
            PsiElement psiElement = root.getPsi();
            if (psiElement != null) {
              buffer.append(psiElement.toString());
            }
            else {
              buffer.append(root.getElementType().toString());
            }
          }
          else {
            if (useElementType) {
              buffer.append(root.getElementType().toString());
            }
            else {
              buffer.append(root.toString());
            }
          }
        }
        else {
          if (useElementType) {
            buffer.append(root.getElementType().toString());
          }
          else {
            String text = fixWhiteSpaces(root.getText());
            buffer.append(root.toString()).append("('").append(text).append("')");
          }
        }
        if (showRanges) buffer.append(root.getTextRange().toString());
        if (showClassNames) buffer.append("[").append(getPsiClassName(root.getPsi())).append("]");
        buffer.append("\n");
        indent += 2;
        if (root instanceof CompositeElement && root.getFirstChildNode() == null && showEmptyChildren()) {
          StringUtil.repeatSymbol(buffer, ' ', indent);
          buffer.append("<empty list>\n");
        }
      }
      catch (IOException e) {
        LOG.error(e);
      }

      super.visitNode(root);
    }
@Override
    protected void visitNode(TreeElement root)