boolean (PsiElement element) { if (element instanceof GrVariable) { return isLocalVariable((GrVariable)element, false); } else if (element instanceof GrReferenceExpression) { final PsiElement resolved = ((GrReferenceExpression)element).resolve(); return resolved instanceof GrVariable && isLocalVariable((GrVariable)resolved, true); } return false; }