void (@NotNull PsiReference reference, @NotNull CompletionResultSet result) { if (reference instanceof DocStringParameterReference) { for (PyNamedParameter param : ((DocStringParameterReference)reference).collectParameterVariants()) { result.addElement(LookupElementBuilder.createWithIcon(param)); } } else if (reference instanceof DocStringTypeReference) { for (Object variant : ((DocStringTypeReference)reference).collectTypeVariants()) { if (variant instanceof PsiNamedElement) { result.addElement(LookupElementBuilder.createWithIcon((PsiNamedElement)variant)); } else { result.addElement(LookupElementBuilder.create(variant)); } } } }