void (List<LookupElement> variants, @Nullable PsiClass iconClass, boolean useFqn, List<PsiClass> containingClasses) { if (iconClass == null) return; String classNamePrefix; if (useFqn) { classNamePrefix = containingClasses.isEmpty() ? iconClass.getQualifiedName() : ContainerUtil.getLastItem(containingClasses).getQualifiedName() + "." + iconClass.getName(); } else { classNamePrefix = containingClasses.isEmpty() ? iconClass.getName() : StringUtil.join(containingClasses, aClass -> aClass.getName(), ".") + "." + iconClass.getName(); } for (PsiField field : iconClass.getFields()) { if (!ProjectIconsAccessor.isIconClassType(field.getType())) continue; String iconPath = classNamePrefix + "." + field.getName(); LookupElementBuilder builder = LookupElementBuilder.create(field, iconPath) .withRenderer(IconPathLookupElementRenderer.INSTANCE); variants.add(builder); } final List<PsiClass> parents = new SmartList<>(containingClasses); parents.add(iconClass); for (PsiClass innerClass : iconClass.getInnerClasses()) { addIconVariants(variants, innerClass, useFqn, parents); } }