public static void openOptionOrPerformAction(@NotNull Object element,
                                               String enteredText,
                                               @Nullable Project project,
                                               @Nullable Component component,
                                               @JdkConstants.InputEventMask int modifiers) {
    // invoke later to let the Goto Action popup close completely before the action is performed
    // and avoid focus issues if the action shows complicated popups itself
    ApplicationManager.getApplication().invokeLater(() -> {
      if (project != null && project.isDisposed()) return;

      if (element instanceof OptionDescription optionDescription) {
        if (optionDescription.hasExternalEditor()) {
          optionDescription.invokeInternalEditor();
        }
        else {
          ShowSettingsUtilImpl.showSettingsDialog(project, optionDescription.getConfigurableId(), enteredText);
        }
      }
      else {
        IdeFocusManager.getInstance(project).doWhenFocusSettlesDown(() -> performAction(element, component, null, modifiers));
      }
    });
  }
public static void openOptionOrPerformAction(@NotNull Object element,
                                               String enteredText,
                                               @Nullable Project project,
                                               @Nullable Component component,
                                               @JdkConstants.InputEventMask int modifiers)