@Nullable
@Override
public String getDocText() {
ErlangFunction prevFunction = PsiTreeUtil.getPrevSiblingOfType(myErlangFunction, ErlangFunction.class);
ErlangSpecification spec = ErlangPsiImplUtil.getSpecification(myErlangFunction);
PsiComment comment = PsiTreeUtil.getPrevSiblingOfType(myErlangFunction, PsiComment.class);
String commentText = "";
if (spec != null && ErlangPsiImplUtil.notFromPreviousFunction(spec, prevFunction)) {
commentText += spec.getText().replaceFirst("spec", "<b>Specification:</b><br/>") + "<br/><br/>";
}
if (comment != null && comment.getTokenType() == ErlangParserDefinition.ERL_FUNCTION_DOC_COMMENT &&
ErlangPsiImplUtil.notFromPreviousFunction(comment, prevFunction)) {
commentText += "<b>Comment:</b><br/>" + ErlangDocUtil.getCommentsText(
ErlangDocUtil.collectPrevComments(comment), "%%", ErlangDocUtil.EDOC_FUNCTION_TAGS);
}
return ErlangDocUtil.wrapInPreTag(commentText);