scala3 icon indicating copy to clipboard operation
scala3 copied to clipboard

Fix span of xml literal

Open som-snytt opened this issue 3 years ago • 4 comments

Forward port https://github.com/scala/scala/commit/f428cc6d94bbfee6ba3f7a956d0eee7126d785af Forward port https://github.com/scala/scala/commit/85136e3f2591f0bf22d3845ecc83081a0b6c4aa4

The dotty reader has lastCharOffset to track where the last char began. There is no need to back up to it.

som-snytt avatar Jul 09 '22 20:07 som-snytt

It turns out you have to wait a while to see the CB output because of the copious tree printing.

image

som-snytt avatar Jul 13 '22 18:07 som-snytt

@prolativ Perhaps you could approve. I highlighted the delta. I haven't looked at the linked draft yet.

som-snytt avatar Sep 04 '22 17:09 som-snytt

This looks good in general but I would advocate for not merging any changes without tests. Also, I can recall some discussion about making people always use only \n as the line end marker. @smarter do you remember some more details about that?

prolativ avatar Sep 05 '22 07:09 prolativ

\r\n is just line separator on Windows. I see I added ParserEdgeTest a few years ago for similar purposes, I'll add a test there. (The point is to supply source text as a String, since usually git normalizes line endings.)

som-snytt avatar Sep 05 '22 08:09 som-snytt