private static Set<LookupElement> suggestQualifierItems( CompletionParameters parameters, PsiJavaCodeReferenceElement qualifier, ElementFilter filter) { String referenceName = qualifier.getReferenceName(); if (referenceName == null) { return Collections.emptySet(); } PrefixMatcher qMatcher = new CamelHumpMatcher(referenceName); Set<LookupElement> plainVariants = JavaSmartCompletionContributor.completeReference( qualifier, qualifier, filter, true, true, parameters, qMatcher); for (PsiClass aClass : PsiShortNamesCache.getInstance(qualifier.getProject()) .getClassesByName(referenceName, qualifier.getResolveScope())) { plainVariants.add(JavaClassNameCompletionContributor.createClassLookupItem(aClass, true)); } if (!plainVariants.isEmpty()) { return plainVariants; } final Set<LookupElement> allClasses = new LinkedHashSet<LookupElement>(); PsiElement qualifierName = qualifier.getReferenceNameElement(); if (qualifierName != null) { JavaClassNameCompletionContributor.addAllClasses( parameters.withPosition(qualifierName, qualifierName.getTextRange().getEndOffset()), true, qMatcher, new CollectConsumer<LookupElement>(allClasses)); } return allClasses; }
public StaticImportConstantFix(@NotNull PsiJavaCodeReferenceElement referenceElement) { myRef = SmartPointerManager.getInstance(referenceElement.getProject()) .createSmartPsiElementPointer(referenceElement); }