Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
We've long wanted to be able to diff definitions against each other.
Adding this machinery here so it can be shared between Share and UCM; but initial plan is to implement Contribution diffs first, then probably add them to Unison Local.
Implementation notes
Uses the Haskell Diff library to compute a diff over syntax text. This means we diff definitions at the semantic token level rather than just over plain-text, which has the benefit that we can still generate links, hovers, cool colors, etc. in the diffs when rendered in the browser.
It also allows us to easily detect and special-case:
We may still want full tree-based structural diffing, but I suspect this form of smart diff will last us a long time.
Test coverage
I have some transcript tests in Share, but this format is still experimental (I'm planning on shipping a version of this for Simon to play with, then will tweak as needed). It doesn't affect any existing UCM behaviour or features, nor is this change observable from the CLI at all.
Loose ends
We need a UI for it! Coming soon™