private static @Nullable Transferable getSelection(@NotNull Editor editor, @NotNull Project project, @NotNull PsiFile file,
                                                     @NotNull CopyPasteOptions options) {
    TypingActionsExtension typingActionsExtension = TypingActionsExtension.findForContext(project, editor);
    try {
      typingActionsExtension.startCopy(project, editor);
      return ProgressManager.getInstance().runProcessWithProgressSynchronously(
        () -> ReadAction.compute(() -> getSelectionAction(editor, project, file, options)),
        ActionsBundle.message("action.EditorCopy.text"), true, project);
    }
    finally {
      typingActionsExtension.endCopy(project, editor);
    }
  }
private static @Nullable Transferable getSelection(@NotNull Editor editor, @NotNull Project project, @NotNull PsiFile file,
                                                     @NotNull CopyPasteOptions options)