@Nullable
  protected PsiElement checkLocalScope() {
    SearchScope searchScope = PsiSearchHelper.getInstance(myElementToRename.getProject()).getUseScope(myElementToRename);
    if (searchScope instanceof LocalSearchScope) {
      PsiElement[] elements = getElements((LocalSearchScope)searchScope);
      return PsiTreeUtil.findCommonParent(elements);
    }

    return null;
  }
@Nullable
  protected PsiElement checkLocalScope()