boolean (@NotNull DataContext context, boolean disableIfRunning) { Project project = context.getData(CommonDataKeys.PROJECT); if (project == null) return false; if (!isVisible(context)) return false; VirtualFile file = VcsContextUtil.selectedFilesIterable(context).single(); if (file == null || file.isDirectory()) return false; FilePath filePath = VcsUtil.getFilePath(file); if (disableIfRunning) { if (BackgroundableActionLock.isLocked(project, VcsBackgroundableActions.COMPARE_WITH, filePath)) { return false; } } AbstractVcs vcs = ChangesUtil.getVcsForFile(file, project); if (vcs == null || vcs.getDiffProvider() == null) return false; if (!AbstractVcs.fileInVcsByFileStatus(project, filePath)) return false; return true; }