void (@NotNull PsiLiteralExpression expression) { super.visitLiteralExpression(expression); PsiReference @NotNull [] references = expression.getReferences(); for (PsiReference reference : references) { if (reference instanceof PsiPolyVariantReference) { PsiElement[] nonMembers = Arrays.stream(((PsiPolyVariantReference)reference).multiResolve(false)) .map(result -> result.getElement()) .filter(e -> !(e instanceof PsiMember)) .toArray(PsiElement[]::new); if (nonMembers.length < 10) { ContainerUtil.addAllNotNull(elementsToCheck, nonMembers); } } else { PsiElement resolve = reference.resolve(); if (resolve != null && !(resolve instanceof PsiMember)) { elementsToCheck.add(resolve); } } } }