PsiReference (PsiDocTag tag) { final PsiDocTagValue valueElement = tag.getValueElement(); if (valueElement != null) { return valueElement.getReference(); } // hack around the fact that a reference to a class is apparently // not a PsiDocTagValue final PsiElement[] dataElements = tag.getDataElements(); if (dataElements.length == 0) { return null; } PsiElement salientElement = null; for (PsiElement dataElement : dataElements) { if (!(dataElement instanceof PsiWhiteSpace)) { salientElement = dataElement; break; } } if (salientElement == null) { return null; } final PsiElement child = salientElement.getFirstChild(); if (!(child instanceof PsiReference)) { return null; } return (PsiReference)child; }