protected void performActionOnElementOccurrences(final IntroduceOperation operation) {
    final Editor editor = operation.getEditor();
    if (editor.getSettings().isVariableInplaceRenameEnabled()) {
      ensureName(operation);
      if (operation.isReplaceAll() != null) {
        performInplaceIntroduce(operation);
      }
      else {
        PyRefactoringUiService.getInstance().showOccurrencesChooser(operation, editor, this::performInplaceIntroduce);
      }
    }
    else {
      PyRefactoringUiService.getInstance().performIntroduceWithDialog(operation, myDialogTitle, myValidator, getHelpId(),
                                                                      o -> {
                                                                        PsiElement declaration = performRefactoring(o);
                                                                        final Editor editor1 = o.getEditor();
                                                                        editor1.getCaretModel()
                                                                          .moveToOffset(declaration.getTextRange().getEndOffset());
                                                                        editor1.getSelectionModel().removeSelection();
                                                                      });
    }
  }
protected void performActionOnElementOccurrences(final IntroduceOperation operation)