Search in sources :

Example 1 with DiffFragmentsProcessor

use of com.intellij.openapi.diff.impl.processing.DiffFragmentsProcessor in project intellij-community by JetBrains.

the class TodoCheckinHandlerWorker method getLineFragments.

private static ArrayList<LineFragment> getLineFragments(final String fileName, String beforeContent, String afterContent) throws VcsException {
    try {
        DiffFragment[] woFormattingBlocks = DiffPolicy.LINES_WO_FORMATTING.buildFragments(DiffString.create(beforeContent), DiffString.create(afterContent));
        DiffFragment[] step1lineFragments = new DiffCorrection.TrueLineBlocks(ComparisonPolicy.IGNORE_SPACE).correctAndNormalize(woFormattingBlocks);
        return new DiffFragmentsProcessor().process(step1lineFragments);
    } catch (FilesTooBigForDiffException e) {
        throw new VcsException("File " + fileName + " is too big and there are too many changes to build a diff", e);
    }
}
Also used : DiffCorrection(com.intellij.openapi.diff.impl.processing.DiffCorrection) FilesTooBigForDiffException(com.intellij.util.diff.FilesTooBigForDiffException) DiffFragment(com.intellij.openapi.diff.ex.DiffFragment) VcsException(com.intellij.openapi.vcs.VcsException) DiffFragmentsProcessor(com.intellij.openapi.diff.impl.processing.DiffFragmentsProcessor)

Aggregations

DiffFragment (com.intellij.openapi.diff.ex.DiffFragment)1 DiffCorrection (com.intellij.openapi.diff.impl.processing.DiffCorrection)1 DiffFragmentsProcessor (com.intellij.openapi.diff.impl.processing.DiffFragmentsProcessor)1 VcsException (com.intellij.openapi.vcs.VcsException)1 FilesTooBigForDiffException (com.intellij.util.diff.FilesTooBigForDiffException)1