@Override public PsiField createPsi(@NotNull final ASTNode node) { if (node instanceof EnumConstantElement) { return new PsiEnumConstantImpl(node); } else { return new PsiFieldImpl(node); } }
@Override public PsiField createPsi(@NotNull final ASTNode node) { if(node instanceof EnumConstantElement) { return new PsiEnumConstantImpl(node); } else { return new PsiFieldImpl(node); } }
private static PsiExpression getInitializer(@NotNull PsiVariable var) { PsiElement navigationElement = var.getNavigationElement(); if(navigationElement instanceof PsiVariable) { var = (PsiVariable) navigationElement; } return var instanceof PsiFieldImpl ? ((PsiFieldImpl) var).getDetachedInitializer() : var.getInitializer(); }