List<List<LineFragment>> (@Nullable DiffComputer diffComputer, @NotNull CharSequence text1, @NotNull CharSequence text2, @NotNull LineOffsets lineOffsets1, @NotNull LineOffsets lineOffsets2, @Nullable List<? extends Range> linesRanges, @NotNull IgnorePolicy ignorePolicy, @NotNull HighlightPolicy highlightPolicy, @NotNull ProgressIndicator indicator) { ComparisonPolicy policy = ignorePolicy.getComparisonPolicy(); InnerFragmentsPolicy fragmentsPolicy = highlightPolicy.getFragmentsPolicy(); if (diffComputer != null && linesRanges != null) { LOG.error(new Throwable("Unsupported operation: ranged diff with custom DiffComputer - " + diffComputer)); } ComparisonManagerImpl comparisonManager = ComparisonManagerImpl.getInstanceImpl(); if (linesRanges == null) { if (diffComputer != null) { List<LineFragment> fragments = diffComputer.compute(text1, text2, policy, fragmentsPolicy != InnerFragmentsPolicy.NONE, indicator); return Collections.singletonList(fragments); } else { List<LineFragment> fragments = comparisonManager.compareLinesInner(text1, text2, lineOffsets1, lineOffsets2, policy, fragmentsPolicy, indicator); return Collections.singletonList(fragments); } } else { List<List<LineFragment>> result = new ArrayList<>(); for (Range range : linesRanges) { result.add(comparisonManager.compareLinesInner(range, text1, text2, lineOffsets1, lineOffsets2, policy, fragmentsPolicy, indicator)); } return result; } }