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