PsiPolyVariantReference () { PsiReference[] otherReferences = ReferenceProvidersRegistry.getReferencesFromProviders(this, PsiReferenceService.Hints.NO_HINTS); PsiPolyVariantReference reference = getReferenceFromNamedArgumentProviders(); if (otherReferences.length == 0) { if (reference != null) { return reference; } else { return new PsiPolyVariantReferenceBase<PsiElement>(this) { @Override public ResolveResult @NotNull [] multiResolve(boolean incompleteCode) { return ResolveResult.EMPTY_ARRAY; } }; } } else { if (reference != null) { PsiReference[] refs = new PsiReference[otherReferences.length + 1]; refs[0] = reference; //noinspection ManualArrayCopy for (int i = 0; i < otherReferences.length; i++) { refs[i + 1] = otherReferences[i]; } otherReferences = refs; } return new PsiMultiReference(otherReferences, this); } }