DiffTool (@NotNull DiffTool tool, @NotNull DiffContext context, @NotNull DiffRequest request) { for (DiffToolSubstitutor substitutor : DiffToolSubstitutor.EP_NAME.getExtensions()) { DiffTool replacement = substitutor.getReplacement(tool, context, request); if (replacement == null) continue; boolean canShow = replacement.canShow(context, request); if (!canShow) { LOG.error("DiffTool substitutor returns invalid tool"); continue; } return replacement; } return null; }