@Nullable
  protected JComponent createSearchScopePanel() {
    var scopeService = RenameScopeService.getInstance(myProject);
    var preselectedScopeName = scopeService.load();
    myScopeCombo = new ScopeChooserCombo();
    myScopeCombo.initialize(myProject, false, true, preselectedScopeName, null)
      .onSuccess(dummy -> {
        var selectedScopeName = myScopeCombo.getSelectedScopeName();
        if (!Objects.equals(selectedScopeName, preselectedScopeName)) { // saved scope not found, fall back to default
          myScopeCombo.selectItem(scopeService.defaultValue());
        }
      });
    myScopeCombo.getComboBox().addItemListener(e -> {
      scopeService.save(myScopeCombo.getSelectedScopeName());
    });
    Disposer.register(myDisposable, myScopeCombo);

    // do not show scope chooser for local variables
    SearchScope useScope = PsiSearchHelper.getInstance(myProject).getUseScope(myPsiElement);
    if (useScope instanceof LocalSearchScope) return null;

    JPanel optionsPanel = new JPanel(new BorderLayout());
    optionsPanel.add(myScopeCombo, BorderLayout.CENTER);
    JComponent separator = SeparatorFactory.createSeparator(FindBundle.message("find.scope.label"), myScopeCombo.getComboBox());
    optionsPanel.add(separator, BorderLayout.NORTH);
    return optionsPanel;
  }
@Nullable
  protected JComponent createSearchScopePanel()