Repository navigation
Conversation
|
Marking this ready for review. I'd been holding it as a draft while #1730 was open, in case you'd rather take contributions one at a time — say the word and I'll close one. A draft doesn't show up in your review queue at all, though, so leaving it that way seemed worse than asking. |
|
Thanks, I'll take a look eventually. |
|
Correction to my comment of 9 August: I said I was marking this ready for review, but the conversion is refused — "Author has reached the open pull request limit". The repository's pull request limit counts non-draft PRs only, and #1730 is my one open non-draft PR here, so this one cannot leave draft while that is open. Apologies for the noise; I only found the real reason today. So: #1730 first, and I'll flip this to ready as soon as it's merged or closed. If you'd rather look at this one instead, say so and I'll close #1730 myself. |
Fixes #1115.
Escape sequences are not interpreted inside raw string literals, so replacing an invisible character there with its escape sequence changes the string's value to the six literal characters of that sequence rather than removing the invisible one. The current testdata golden file records exactly that: the
e = ...line holds a raw literal whose zero-width space has been "replaced" by six visible characters.The message has the same problem: it tells the user to use an escape sequence that would not work where they are.
For raw string literals this now offers only the deletion fix, and the message points at an interpreted string literal instead. On a file with the same zero-width space in both kinds of literal:
The golden file loses its
replace format character U+200B with ...section, which the test flags on its own: without that removal,TestTestdatafails with "golden has section for suggested fix ..., but we didn't produce any fix by that name".I did not add testdata rows for a raw literal holding several invisible characters, since every added line rewrites all eight golden sections; happy to do it if you'd rather have the coverage.
(Edited: the first version of this description contained literal zero-width characters in the places where the escape sequence was meant to be shown, which rather made the point.)