record (@NotNull CopyPasteOptions copyPasteOptions, @Nullable List<CaretState> caretStateToRestore) { private static final @NotNull DataKey<SelectionToCopy> KEY = DataKey.create("CopyAction.SelectionToCopy.KEY"); public static @Nullable SelectionToCopy fromDataContext(@NotNull DataContext dataContext) { return KEY.getData(dataContext); } public @NotNull DataContext extendDataContext(@NotNull DataContext dataContext) { return CustomizedDataContext.create(dataContext, dataId -> KEY.is(dataId) ? this : null); } }