private static void showPopup(Editor editor, List<AnAction> applicable) {
    DataContext context = DataManager.getInstance().getDataContext(editor.getContentComponent());
    JBPopupFactory.ActionSelectionAid mnemonics = JBPopupFactory.ActionSelectionAid.MNEMONICS;
    DefaultActionGroup group = new DefaultActionGroup(applicable.toArray(AnAction.EMPTY_ARRAY));
    ListPopup popup = JBPopupFactory.getInstance()
      .createActionGroupPopup(CodeInsightBundle.message("surround.with.chooser.title"), group, context, mnemonics, true);
    Project project = editor.getProject();
    if (project != null) {
      PreviewHandler<PopupFactoryImpl.ActionItem> handler = new PreviewHandler<>(project, popup, PopupFactoryImpl.ActionItem.class, act -> {
        AnAction action = act.getAction();
        if (action instanceof AnActionWithPreview actionWithPreview) {
          return actionWithPreview.getPreview();
        }
        return IntentionPreviewInfo.EMPTY;
      });
      popup.showInBestPositionFor(editor);
      handler.showInitially();
    }
  }
private static void showPopup(Editor editor, List<AnAction> applicable)