@Override
  @Nullable
  public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
    if (element instanceof GrVariable || element instanceof GrImplicitVariable) {
      @Nls StringBuilder buffer = new StringBuilder();
      PsiVariable variable = (PsiVariable)element;

      if (originalElement instanceof GrVariableDeclaration && ((GrVariableDeclaration)originalElement).getVariables().length > 1) {
        for (GrVariable var : ((GrVariableDeclaration)originalElement).getVariables()) {
          generateVariableInfo(originalElement, buffer, var);
          buffer.append("\n\n");
        }
      }
      else {
        generateVariableInfo(originalElement, buffer, variable);
      }
      return buffer.toString();
    }
    else if (element instanceof PsiMethod method) {
      @Nls StringBuilder buffer = new StringBuilder();
      if (method instanceof GrGdkMethod) {
        appendStyledSpan(buffer, "[" + GroovyBundle.message("documentation.gdk.label") + "]", "color: #909090");
      }
      else {
        PsiClass hisClass = method.getContainingClass();
        if (hisClass != null) {
          String qName = hisClass.getQualifiedName();
          if (qName != null) {
            appendStyledSignatureFragment(buffer, qName, GroovyDocHighlightingManager.getInstance().getClassDeclarationAttributes(hisClass));
            buffer.append("\n");
          }
        }
      }

      PsiSubstitutor substitutor = calcSubstitutor(originalElement);
      if (!method.isConstructor()) {
        final PsiType substituted = substitutor.substitute(PsiUtil.getSmartReturnType(method));
        appendTypeString(buffer, substituted, originalElement, false);
        buffer.append(" ");
      }
      appendStyledSignatureFragment(buffer, method.getName(),
                                    GroovyDocHighlightingManager.getInstance().getMethodDeclarationAttributes(method));
      appendStyledSignatureFragment(buffer, "(", GroovyDocHighlightingManager.getInstance().getParenthesesAttributes());
      PsiParameter[] parameters = method.getParameterList().getParameters();
      for (int i = 0; i < parameters.length; i++) {
        PsiParameter parameter = parameters[i];
        if (i > 0) appendStyledSignatureFragment(buffer, ", ", GroovyDocHighlightingManager.getInstance().getCommaAttributes());
        if (parameter instanceof GrParameter) {
          GroovyPresentationUtil.appendParameterPresentation(
            (GrParameter)parameter, substitutor, TypePresentation.LINK, buffer,
            DocumentationSettings.isHighlightingOfQuickDocSignaturesEnabled());
        }
        else {
          PsiType type = parameter.getType();
          appendTypeString(buffer, substitutor.substitute(type), originalElement, false);
          buffer.append(" ");
          appendStyledSignatureFragment(buffer, parameter.getName(), GroovyDocHighlightingManager.getInstance().getParameterAttributes());
        }
      }
      appendStyledSignatureFragment(buffer, ")", GroovyDocHighlightingManager.getInstance().getParenthesesAttributes());
      final PsiClassType[] referencedTypes = method.getThrowsList().getReferencedTypes();
      if (referencedTypes.length > 0) {
        appendStyledSignatureFragment(buffer, "\nthrows ", GroovyDocHighlightingManager.getInstance().getKeywordAttributes());
        for (int i = 0; i < referencedTypes.length; i++) {
          PsiClassType referencedType = referencedTypes[i];
          appendTypeString(buffer, referencedType, originalElement, false);
          if (i != referencedTypes.length - 1) {
            appendStyledSignatureFragment(buffer, ", ", GroovyDocHighlightingManager.getInstance().getCommaAttributes());
          }
        }
      }
      return buffer.toString();
    }
    else if (element instanceof GrTypeDefinition) {
      return generateClassInfo((GrTypeDefinition)element);
    }
    else if (element instanceof GroovyMapProperty mapProperty) {
      @Nls StringBuilder buffer = new StringBuilder();
      appendStyledSpan(buffer, "Map property\n");
      PsiType inferredType = mapProperty.getPropertyType();
      String typeLabel = inferredType != null
                         ? GroovyBundle.message("documentation.inferred.type.label")
                         : GroovyBundle.message("documentation.cannot.infer.type.label");
      appendStyledSpan(buffer, "[" + typeLabel + "]", "color: #909090");
      if (inferredType != null) {
        buffer.append(" ");
        appendTypeString(buffer, inferredType, originalElement, false);
      }
      buffer.append(" ");
      appendStyledSignatureFragment(buffer, mapProperty.getName(), GroovyDocHighlightingManager.getInstance().getClassNameAttributes());
      return buffer.toString();
    }

    return null;
  }
@Override
  @Nullable
  public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement)