LookupElementBuilder (@NotNull PsiClass psiClass, final String lookupString, final boolean withLocation) { LookupElementBuilder builder = LookupElementBuilder.create(psiClass, lookupString).withIcon(psiClass.getIcon(Iconable.ICON_FLAG_VISIBILITY)); String name = psiClass.getName(); if (StringUtil.isNotEmpty(name)) { builder = builder.withLookupString(name); } if (withLocation) { return builder.withTailText(" (" + PsiFormatUtil.getPackageDisplayName(psiClass) + ")", true); } return builder; }