expand locs into whitespace
when creating the following diagnostic
error: Unexpected `=`, expected `:`, `,`, or `)`
┌─ main.spade:6:10
│
6 │ f$(x = a)
│ ^ expected `:`, `,`, or `)`
│
= named arguments are specified with `:`
│
6 │ f$(x : a)
│ ~
we write
diag.span_suggest_replace(
"named arguments are specified with `:`",
tok.loc(),
":",
)
it would be nice if we could do something like
diag.span_suggest_replace(
"named arguments are specified with `:`",
tok.loc().up_to_previous_token(),
":"
)
in order to change the replacement to
f$(x: a)