If my string is `"foo\n.bar()"` and the error span points to this whole expression, then I can't map that back into the original string (because the parsed text is one character shorter than the source string, but I don't actually know how to map arbitrary spans form the parsed string back to the source string). In fact, even my original example, where the length-3 span remains a length-3 span, doesn't work because I don't know where it should start.

That said, I agree that e.g. mismatched type errors could be mapped back to the entire source string. I'll look into folding the spans.