private void invokeScopeStep(@NotNull Target target,
                               @NotNull PsiFile file,
                               @NotNull Editor editor,
                               @NotNull Project project) {
    List<Scope> scopes = collectTargetScopes(target, editor, file, project);

    if (scopes.isEmpty()) {
      String message = RefactoringBundle.getCannotRefactorMessage(getEmptyScopeErrorMessage());
      showErrorHint(message, editor, project);
      return;
    }

    if (scopes.size() == 1) {
      invokeFindUsageStep(target, scopes.get(0), file, editor, project);
    }
    else {
      @SuppressWarnings("unchecked") Scope[] scopeArray = (Scope[])PsiUtilCore.toPsiElementArray(scopes);
      NavigationUtil.getPsiElementPopup(scopeArray, getScopeRenderer(), getChooseScopeTitle(), scope -> {
        invokeFindUsageStep(target, scope, file, editor, project);
        return false;
      }).showInBestPositionFor(editor);
    }
  }
private void invokeScopeStep(@NotNull Target target,
                               @NotNull PsiFile file,
                               @NotNull Editor editor,
                               @NotNull Project project)