@NotNull
  IntentionActionWithTextCaching wrapAction(@NotNull HighlightInfo.IntentionActionDescriptor descriptor,
                                            @NotNull PsiElement element,
                                            @NotNull PsiFile containingFile,
                                            @Nullable Editor containingEditor) {
    IntentionActionWithTextCaching cachedAction =
      new IntentionActionWithTextCaching(
        descriptor.getAction(), descriptor.getDisplayName(), descriptor.getIcon(), descriptor.getToolId(),
        descriptor.getFixRange(), (cached, action) -> {
          if (QuickFixWrapper.unwrap(action) != null) {
            // remove only inspection fixes after invocation,
            // since intention actions might be still available
            removeActionFromCached(cached);
            markInvoked(action);
          }
        });
    for (IntentionAction option : descriptor.getOptions(element, containingEditor)) {
      Editor editor = ObjectUtils.chooseNotNull(myEditor, containingEditor);
      if (editor == null) continue;
      var problemOffset = myOffset >= 0 ? myOffset : editor.getCaretModel().getOffset();
      Pair<PsiFile, Editor> availableIn = ShowIntentionActionsHandler
        .chooseBetweenHostAndInjected(myFile, editor, problemOffset, containingFile,
                                      (f, e, o) -> ShowIntentionActionsHandler.availableFor(f, e, o, option));
      if (availableIn == null) continue;
      IntentionActionWithTextCaching textCaching = new IntentionActionWithTextCaching(option);
      boolean isErrorFix = myErrorFixes.contains(textCaching);
      if (isErrorFix) {
        cachedAction.addErrorFix(option);
      }
      boolean isInspectionFix = myInspectionFixes.contains(textCaching);
      if (isInspectionFix) {
        cachedAction.addInspectionFix(option);
      }
      else {
        cachedAction.addIntention(option);
      }
    }
    return cachedAction;
  }
@NotNull
  IntentionActionWithTextCaching wrapAction(@NotNull HighlightInfo.IntentionActionDescriptor descriptor,
                                            @NotNull PsiElement element,
                                            @NotNull PsiFile containingFile,
                                            @Nullable Editor containingEditor)