void (PsiClass psiClass, @Nullable Set<? super PsiClass> visited, String prefix) { boolean isInnerClass = StringUtil.isNotEmpty(prefix); if (isInnerClass && isProcessedIndependently(psiClass)) { return; } if (filter.isAcceptable(psiClass, insertedElement)) { if (!inJavaContext) { JavaPsiClassReferenceElement element = AllClassesGetter.createLookupItem(psiClass, AllClassesGetter.TRY_SHORTENING); element.setLookupString(prefix + element.getLookupString()); consumer.consume(element); } else { Condition<PsiClass> condition = eachClass -> filter.isAcceptable(eachClass, insertedElement) && AllClassesGetter.isAcceptableInContext(insertedElement, eachClass, filterByScope, pkgContext); for (JavaPsiClassReferenceElement element : createClassLookupItems(psiClass, afterNew, JAVA_CLASS_INSERT_HANDLER, condition)) { element.setLookupString(prefix + element.getLookupString()); JavaConstructorCallElement.wrap(element, insertedElement).forEach( e -> consumer.consume(highlighter.highlightIfNeeded(null, e, e.getObject()))); if (patternContext) { JavaPatternCompletionUtil.addPatterns(consumer::consume, insertedElement, element.getObject()); } } } } else { String name = psiClass.getName(); if (name != null) { PsiClass[] innerClasses = psiClass.getInnerClasses(); if (innerClasses.length > 0) { if (visited == null) visited = new HashSet<>(); for (PsiClass innerClass : innerClasses) { if (visited.add(innerClass)) { processClass(innerClass, visited, prefix + name + "."); } } } } } }