void (@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 addedLink = !useSingleLink && appendLink(sb, original != null ? original : element); original = null; // do not use a link to the original element if it is already added // Swing uses simple HTML processing and paints a link incorrectly if it contains different fonts. // This is the reason why I use monospaced font not only for element name, but for a whole link. // By the same reason I have to comment out support for deprecated elements. // // boolean deprecated = RefJavaUtil.isDeprecated(element); // if (deprecated) sb.append("<strike>"); // sb.append("<code>"); sb.append(name); // sb.append("</code>"); // if (deprecated) sb.append("</strike>"); if (addedLink) sb.append("</code></a>"); } 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("</code></a>"); }