PsiElement (Project project, String text) { GrDocComment comment = GroovyPsiElementFactory.getInstance(project).createDocCommentFromText(text); PsiElement tag = PsiTreeUtil.getChildOfType(comment, GrDocTag.class); PsiElement ref = PsiTreeUtil.getChildOfType(tag, GrDocMethodReference.class); assert ref != null : text; return replace(ref); }