static @Nullable PsiElement resolveReference(PsiReference psiReference) {
    return DumbService.getInstance(psiReference.getElement().getProject()).computeWithAlternativeResolveEnabled(() -> {
      if (psiReference instanceof PsiPolyVariantReference) {
        ResolveResult[] results = ((PsiPolyVariantReference)psiReference).multiResolve(true);
        if (results.length == 1) return results[0].getElement();
      }
      return psiReference.resolve();
    });
  }
static @Nullable PsiElement resolveReference(PsiReference psiReference)