boolean (PsiVariable variable, PsiElement scope) { for (PsiReference reference : ReferencesSearch.search(variable, new LocalSearchScope(scope), false)) { if (isAssignmentLHS(reference.getElement())) return true; } return false; }