public static boolean canShowDiff(DiffRequest data) { DiffContent[] contents = data.getContents(); if (contents.length != 2) return false; for (DiffContent content : contents) { if (content.isBinary()) return false; VirtualFile file = content.getFile(); if (file != null && file.isDirectory()) return false; } return true; }