private static boolean executeChoose(@NotNull ActionContext context, ModChooseAction chooser, @Nullable Editor editor) {
    record ActionAndPresentation(@NotNull ModCommandAction action, @NotNull Presentation presentation) {}
    VirtualFile file = context.file().getVirtualFile();
    if (file == null) return false;
    Editor finalEditor = editor == null ? getEditor(context.project(), file) : editor;
    if (finalEditor == null) return false;
    ReadAction.nonBlocking(() -> {
      return StreamEx.of(chooser.actions()).mapToEntry(action -> action.getPresentation(context))
        .nonNullValues().mapKeyValue(ActionAndPresentation::new).toList();
    }).finishOnUiThread(ModalityState.defaultModalityState(), actions -> {
      if (actions.isEmpty()) return;

      String name = chooser.title();
      if (actions.size() == 1) {
        ModCommandAction action = actions.get(0).action();
        ModCommandExecutor.executeInteractively(context, name, editor, () -> {
          if (action.getPresentation(context) == null) return ModCommand.nop();
          return action.perform(context);
        });
        return;
      }
      List<IntentionActionWithTextCaching> actionsWithTextCaching = ContainerUtil.map(
        actions, (actionAndPresentation) -> {
          IntentionAction intention = new ModCommandActionWrapper(actionAndPresentation.action(), actionAndPresentation.presentation());
          return new IntentionActionWithTextCaching(intention);
        });
      IntentionContainer intentions = new IntentionContainer() {
        @Override
        public @NotNull String getTitle() {
          return chooser.title();
        }

        @Override
        public @NotNull List<IntentionActionWithTextCaching> getAllActions() {
          return actionsWithTextCaching;
        }

        @Override
        public @NotNull IntentionGroup getGroup(@NotNull IntentionActionWithTextCaching action) {
          return IntentionGroup.OTHER;
        }

        @Override
        public @Nullable Icon getIcon(@NotNull IntentionActionWithTextCaching action) {
          return action.getIcon();
        }
      };
      IntentionHintComponent.showIntentionHint(context.project(), context.file(), finalEditor, true, intentions);
    }).submit(AppExecutorUtil.getAppExecutorService());
    return true;
  }
private static boolean executeChoose(@NotNull ActionContext context, ModChooseAction chooser, @Nullable Editor editor)