protected void appendElement(@NotNull StringBuilder sb, @NotNull PsiElement element, boolean skip) {
    boolean useSingleLink = Registry.is("gutter.tooltip.single.link");
    boolean addedSingleLink = useSingleLink && appendLink(sb, element);
    String locationString = getLocationString(element);
    PsiElement original = element; // use original member as a first separate link
    if (skip && shouldSkipAsFirstElement(element)) {
      element = getContainingElement(element);
    }
    while (element != null) {
      String name = getPresentableName(element);
      if (name != null) {
        boolean deprecated = isDeprecated(element);
        if (deprecated && !useSingleLink) {
          sb.append("<strike>");
        }
        boolean addedLink = !useSingleLink && appendLink(sb, original != null ? original : element);
        original = null; // do not use a link to the original element if it is already added
        sb.append(name);
        if (addedLink) sb.append("</a></code>");
        if (deprecated && !useSingleLink) {
          sb.append("</strike>");
        }
      }
      PsiElement parent = element instanceof PsiFile? null : getContainingElement(element);
      if (parent == null || parent instanceof PsiFile) {
        if (locationString != null) {
          sb.append(locationString);
        }
        break;
      }
      if (name != null) sb.append(" ").append(LangBundle.message("tooltip.in")).append(" ");
      element = parent;
    }
    if (addedSingleLink) sb.append("</a></code>");
  }
protected void appendElement(@NotNull StringBuilder sb, @NotNull PsiElement element, boolean skip)