private static boolean shouldKeepSpace(PsiElement parent) {
    ASTNode node = parent.getNode();
    if (node == null) {
      return true;
    }

    IElementType type = node.getElementType();
    if (type == JavaDocElementType.DOC_TAG_VALUE_ELEMENT) {
      return PsiTreeUtil.getParentOfType(parent, PsiDocMethodOrFieldRef.class) != null;
    }

    return type == JavaDocElementType.DOC_COMMENT || type == JavaDocElementType.DOC_TAG || type == JavaDocElementType.DOC_INLINE_TAG;
  }
private static boolean shouldKeepSpace(PsiElement parent)