Syntactic diffing with interpolation is an interesting problem.
Same: 1 + 2 vs 1+2
Different: "1 + 2" vs "1+2"
Same: "#{1 + 2}" vs "#{1+2}"
Difftastic is smart enough to get the first two cases correct, but still considers the third case to be different strings.
miniblog.
Related Posts
A cute systemd feature to get the system clock roughly correct: if the system time is before the compilation time of the systemd binary, it moves the clock forward to that time!
There are *so many* ways that reading a text file can fail.
Maybe it doesn't exist, it's a broken symlink, it's actually a directory, it's not the encoding you expected, or perhaps you just don't have the correct permissions.
Reporting good errors is surprisingly labour intensive.
In LSP, a position is represented as a line number and a column offset (in Unicode code units): https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position
This is pretty elegant. You'll get the correct line regardless of encoding bugs, and the editor already knows the line number so it's cheap to compute.