@Override
  public void execute(@NotNull Editor editor, DataContext dataContext, @Nullable Producer<? extends Transferable> producer) {
    final Transferable transferable = getContentsToPasteToEditor(producer);
    if (transferable == null) return;

    if (!EditorModificationUtil.checkModificationAllowed(editor)) return;
    if (!EditorModificationUtil.requestWriting(editor)) return;

    DataContext context = CustomizedDataContext.withSnapshot(dataContext, sink -> {
      sink.set(PasteAction.TRANSFERABLE_PROVIDER, () -> transferable);
    });

    final Project project = editor.getProject();
    final Document document = editor.getDocument();
    final PsiFile file = project == null ? null : PsiDocumentManager.getInstance(project).getPsiFile(document);
    if (file == null || editor.isColumnMode() || editor.getCaretModel().getCaretCount() > 1) {
      if (myOriginalHandler != null) {
        myOriginalHandler.execute(editor, null, context);
      }
      return;
    }

    DumbService.getInstance(project).runWithAlternativeResolveEnabled(() -> {
      document.startGuardedBlockChecking();
      try {
        for (PasteProvider provider : EP_NAME.getExtensionList()) {
          if (provider.isPasteEnabled(context)) {
            provider.performPaste(context);
            return;
          }
        }
        doPaste(editor, project, file, document, transferable);
      }
      catch (ReadOnlyFragmentModificationException e) {
        EditorActionManager.getInstance().getReadonlyFragmentModificationHandler(document).handle(e);
      }
      finally {
        document.stopGuardedBlockChecking();
      }
    });
  }
@Override
  public void execute(@NotNull Editor editor, DataContext dataContext, @Nullable Producer<? extends Transferable> producer)