void (@NotNull final JavaSmartCompletionParameters parameters, @NotNull Consumer<? super LookupElement> result, final PrefixMatcher matcher) { PsiType expectedType = parameters.getDefaultType(); if (!InheritanceUtil.isInheritor(expectedType, CommonClassNames.JAVA_LANG_CLASS)) { expectedType = parameters.getExpectedType(); if (!InheritanceUtil.isInheritor(expectedType, CommonClassNames.JAVA_LANG_CLASS)) { return; } } PsiType classParameter = PsiUtil.substituteTypeParameter(expectedType, CommonClassNames.JAVA_LANG_CLASS, 0, false); boolean addInheritors = false; PsiElement position = parameters.getPosition(); if (classParameter instanceof PsiWildcardType wildcardType) { classParameter = wildcardType.isSuper() ? wildcardType.getSuperBound() : wildcardType.getExtendsBound(); addInheritors = !wildcardType.isSuper() && classParameter instanceof PsiClassType && !(matcher.getPrefix().isEmpty() && TypeUtils.isJavaLangObject(classParameter)); } else if (!matcher.getPrefix().isEmpty()) { addInheritors = true; classParameter = PsiType.getJavaLangObject(position.getManager(), position.getResolveScope()); } if (classParameter != null) { PsiFile file = position.getContainingFile(); addClassLiteralLookupElement(classParameter, result, file); if (addInheritors) { addInheritorClassLiterals(file, classParameter, result, matcher); } } }