unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.81k stars 271 forks source link

Fix diff computation #5460

Closed ChrisPenner closed 5 days ago

ChrisPenner commented 5 days ago

Overview

Diffs were rendering very strangely, there was an error with how whitespace (which has no annotation) was being treated.

This fixes whitespace rendering, and also limits the diff special-casing to definition references to limit other strange behaviour.

I also noticed the version on trunk could bomb out if it got certain types of whitespace diffs, so this should resolve that too.

Here are a couple before and afters:


take!

Before:

image

After:

image

completion

Before:

image

After:

image

Simon is going to alter the frontend a bit to avoid unnecessary colouring on the whitespace.

Implementation notes

ChrisPenner commented 5 days ago

I'm going to go ahead and merge this, Arya is out for the week, it's passing tests, can't be worse than the broken version we already have deployed, and also doesn't even run in UCM itself so can't cause much harm 🤷🏼‍♂️