cursorless icon indicating copy to clipboard operation
cursorless copied to clipboard

Fix typescript text fragments when there is an escape sequence

Open pokey opened this issue 1 year ago • 0 comments

In the following code:

"hello\nworld"

textFragment currently looks like:

image

We should have one text fragment for the entire inside of the string

Here's parse tree:

(string
    """
    (string_fragment)
    (escape_sequence)
    (string_fragment)
    """
)

should be easy with range

Though we need to be a bit careful because we don't want to eat interpolations, only escape sequences. Although I wonder how we can support

`aaa (bbb ${ccc} ddd) eee`

I would expect "take round" to work from bbb. Probably also from ccc, tho I could see a case against that as we're in a syntactic region so might not want text-based pairs to match

pokey avatar Jun 10 '24 13:06 pokey