boolean (@NotNull AnActionEvent e) { DiffRequest request = e.getData(DIFF_REQUEST); if (request != null) { return true; } VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY); if (files == null) { return false; } if (files.length == 0 || files.length > 3) return false; boolean hasContent = ContainerUtil.all(Arrays.asList(files), BaseShowDiffAction::hasContent); if (!hasContent) return false; if (files.length == 3) { Set<Type> types = ContainerUtil.map2Set(files, CompareFilesAction::getType); if (types.contains(Type.DIRECTORY) || types.contains(Type.ARCHIVE)) return false; } return true; }