void (@NotNull AnActionEvent e) { FilePath filePath = e.getRequiredData(VcsDataKeys.FILE_PATH); VcsFileRevision[] revisions = e.getRequiredData(VcsDataKeys.VCS_FILE_REVISIONS); if (filePath.isDirectory()) { if (revisions.length != 1) return; AbstractVcs vcs = VcsUtil.findVcsByKey(e.getRequiredData(CommonDataKeys.PROJECT), e.getRequiredData(VcsDataKeys.VCS)); if (vcs == null) return; ProgressManager.getInstance().run(new FolderPatchCreationTask(vcs, revisions[0])); } }