Providing own diff mechanism in MergeView

Hi everyone.

I need to show differences in the MergeView that are not computed using the existing diff computation mechanism but rather in some other way.

I would like to be able to provide our own diff computation mechanism or precomputed chunks for the MergeView.

Could it be somewhat achievable even in some hacky way (without forking the merge addon)?

My first thought has been to patch the diff utility somehow or using the StateEffect to update the chunks.

This isn’t something that the library currently supports. Why do you want to use a custom diff implementation? And are you sure your implementation is fast enough on big files to be usable in this context?

The diff is computed on the server (based on xmlunit) in a different format (performance is not an issue in that regard).We would like to compute a diff in codemirror format based on that server-side calculation.

That sounds like it’d be asynchronous (and thus slow to update when the document is edited). I don’t think this is going to be possible with the @codemirror/merge package.