PsiType (PsiElement element) { if (element instanceof GrVariable) { return ((GrVariable)element).getTypeGroovy(); } else if (element instanceof GrReferenceExpression) return ((GrReferenceExpression)element).getType(); return null; }