RefElement (@NotNull final PsiElement psi) { if (!getLanguages().contains(psi.getLanguage())) { return null; } if (psi instanceof PsiFile) { return new RefJavaFileImpl((PsiFile)psi, myRefManager); } else if (psi instanceof PsiJavaModule) { return new RefJavaModuleImpl((PsiJavaModule)psi, myRefManager); } UElement uElement = psi instanceof UElement ? (UElement)psi : UastContextKt.toUElement(psi); if (uElement instanceof UClass) { return new RefClassImpl((UClass)uElement, psi, myRefManager); } if (uElement instanceof UMethod) { return new RefMethodImpl((UMethod)uElement, psi, myRefManager); } else if (uElement instanceof UField) { return new RefFieldImpl((UField)uElement, psi, myRefManager); } else if (uElement instanceof ULambdaExpression || uElement instanceof UCallableReferenceExpression) { return new RefFunctionalExpressionImpl((UExpression)uElement, psi, myRefManager); } return null; }