Diff sliders are a really interesting problem for AST diffs. Here's a surprising example.
At first, it looks like the first `|` should be highlighted. However the first `|` is the outer `match` case, and the inner | is syntactically an or-pattern!
miniblog.
Related Posts
TIL rustc has a style guide for suggestions! https://rustc-dev-guide.rust-lang.org/diagnostics.html#suggestion-style-guide
They recommend avoiding 'did you mean' or 'the following' in favour of direct suggestions and highlighted positions.
Neat cargo plugin I haven't seen before: https://crates.io/crates/cargo-expand
`cargo expand` will expand macros so you can see the regular Rust code produced. For example, println!(); expands to this (even syntax highlighted!).
Readable tree diffing is a really interesting problem. When do you highlight lists? Do you highlight all the lists enclosing a modified subtree? What about comments?
I'm relatively happy with this case, but I think the outermost lists shouldn't be highlighted at all.


