void (@NotNull StringBuilder buf, RefElement refElement, boolean isPackageIncluded) { final HTMLComposerExtension extension = getLanguageExtension(refElement); if (extension != null) { extension.appendReferencePresentation(refElement, buf, isPackageIncluded); } else if (refElement instanceof RefFile || refElement instanceof RefDirectory) { buf.append(A_HREF_OPENING); buf.append(((RefElementImpl)refElement).getURL()); buf.append("\">"); String refElementName = refElement.getName(); final PsiElement element = refElement.getPsiElement(); if (element != null) { VirtualFile file = PsiUtilCore.getVirtualFile(element); if (file != null) { refElementName = ProjectUtilCore.displayUrlRelativeToProject(file, file.getPresentableUrl(), element.getProject(), true, false); } } buf.append(refElementName); buf.append(A_CLOSING); } }