private PsiElement @NotNull [] getElements(LocalSearchScope searchScope) {
    PsiElement[] elements = searchScope.getScope();
    FileViewProvider provider = myElementToRename.getContainingFile().getViewProvider();
    for (PsiElement element : elements) {
      if (!(element instanceof PsiFile) || ((PsiFile)element).getViewProvider() != provider) {
        return elements;
      }
    }
    return new PsiElement[] { myElementToRename.getContainingFile() };
  }
private PsiElement @NotNull [] getElements(LocalSearchScope searchScope)