String (@NotNull PsiElement highlight) { final PsiElement parent = highlight.getParent(); if (parent instanceof GrVariable) { return ((GrVariable)parent).getName(); } else if (highlight instanceof GrReferenceExpression && parent instanceof GrAssignmentExpression && ((GrAssignmentExpression)parent).getLValue() == highlight) { final PsiElement resolved = ((GrReferenceExpression)highlight).resolve(); if (resolved instanceof GrVariable && PsiUtil.isLocalVariable(resolved)) { return ((GrVariable)resolved).getName(); } } return null; }