@Override
  @Nullable
  public @Nls String generateDoc(PsiElement element, PsiElement originalElement) {
    GroovyDocHighlightingManager highlightingManager = GroovyDocHighlightingManager.getInstance();

    if (element instanceof GdslNamedParameter) {
      String name = ((GdslNamedParameter)element).getName();
      if (name == null) {
        return null;
      }
      StringBuilder buffer = new StringBuilder("<pre>");
      String parameterTypeText = ((GdslNamedParameter)element).myParameterTypeText;
      appendStyledSignatureFragment(buffer, name, highlightingManager.getParameterAttributes());
      if (parameterTypeText != null) {
        appendStyledSignatureFragment(buffer, ":", highlightingManager.getOperationSignAttributes());
        buffer.append(" ");
        appendStyledSignatureFragment(buffer, parameterTypeText, highlightingManager.getClassNameAttributes());
      }
      buffer.append("</pre>");
      String docString = ((GdslNamedParameter)element).docString;
      if (docString != null) {
        buffer.append("<p>").append(HtmlChunk.text(docString)).append("</p>");
      }
      return buffer.toString(); //NON-NLS
    }

    if (element instanceof GrReferenceExpression) {
      return getMethodCandidateInfo((GrReferenceExpression)element);
    }

    element = getDocumentationElement(element, originalElement);

    if (element == null) return null;

    String standard = generateExternalJavaDoc(element);

    if (element instanceof GrVariable &&
        ((GrVariable)element).getDeclaredType() == null &&
        standard != null) {
      final String truncated = StringUtil.trimEnd(standard, BODY_HTML);

      @Nls StringBuilder buffer = new StringBuilder(truncated);
      buffer.append("<p style='padding-left:8px;'>");
      if (originalElement != null) {
        appendInferredType(originalElement, (GrVariable)element, buffer, false);
      }
      else if (element.getParent() instanceof GrVariableDeclaration) {
        appendInferredType(element.getParent(), (GrVariable)element, buffer, false);
      }

      if (!truncated.equals(standard)) {
        buffer.append(BODY_HTML);
      }
      standard = buffer.toString();
    }

    String gdslDoc = element.getUserData(NonCodeMembersHolder.DOCUMENTATION);
    if (gdslDoc != null) {
      if (standard != null) {
        String truncated = StringUtil.trimEnd(standard, BODY_HTML);
        String appended = truncated + "<p>" + gdslDoc; //NON-NLS
        if (truncated.equals(standard)) {
          return appended;
        }
        return appended + BODY_HTML;
      }
      return gdslDoc;
    }

    return standard;
  }
@Override
  @Nullable
  public @Nls String generateDoc(PsiElement element, PsiElement originalElement)