views:

23

answers:

1

I am writing an eclipse plugin which needs to be able to determine which lines of a file have changed compared to a different version of the same file.

Is there an existing class or library which I can use for this task?

The closest I have found is org.eclipse.compare.internal.merge.DocumentMerger. This can be used to find the information I need but is in an internal package so is not suitable for me to use. I could copy/paste the source of this class and adapt it to my requirements. However, I am hoping there is an existing library to handle textual comparisons.

A: 

For textual comparisons, try the google-diff-match-patch library. (I don't know whether Eclipse already has something similar built-in.)

Esko Luontola
This worked great - thanks :)
mchr