LookupElementBuilder (@NotNull PsiMethod method, @NotNull String lookupString, final @NotNull PsiSubstitutor substitutor, @Nullable PsiClass qualifierClass) { LookupElementBuilder builder = LookupElementBuilder.create(method, lookupString) .withIcon(method.getIcon(Iconable.ICON_FLAG_VISIBILITY)) .withPresentableText(method.getName()) .withTailText(PsiFormatUtil.formatMethod(method, substitutor, PsiFormatUtilBase.SHOW_PARAMETERS, PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_TYPE)); final PsiType returnType = method.getReturnType(); if (returnType != null) { builder = builder.withTypeText(substitutor.substitute(returnType).getPresentableText()); } builder = setBoldIfInClass(method, qualifierClass, builder); return builder; }