ipatalas / vscode-postfix-ts

Postfix notation for TypeScript/Javascript - extension for VS Code
MIT License
159 stars 43 forks source link

Incorrect expanding of `$a.$a` with double `{{expr}}` in snippet #55

Closed zardoy closed 2 years ago

zardoy commented 2 years ago

Example snippet:

{
    "name": "that",
    "description": "",
    "body": "console.log('${1:{{expr}}}', {{expr}})$2",
    "when": ["identifier", "expression", "function-call"]
},

I don't really expect fix soon as I see I isn't maintained anymore, just recording for future work it here.

To reproduce:

  1. Write $a.$a in empty file
  2. Expand with .that (see snippet above)

Actual: console.log('$a.', $a.) (probably incorrect $ escaping) Expected: console.log('$a.$a', $a.$a)

You can try this snippet with other expressions ($a.a for example) where it works correctly

ipatalas commented 2 years ago

Can you elaborate on expected behavior? What's the input? Is it a. and is it about the dot after replacement?

zardoy commented 2 years ago

Can you elaborate on expected behavior?

Surely! I updated the body of the issue, hope it helps.

ipatalas commented 2 years ago

Well, you were absolutely right about escaping: https://github.com/ipatalas/vscode-postfix-ts/commit/1a7bfc111ff4d1ef7c7ad071a9a6dc8c15eece35

Thanks :)

zardoy commented 2 years ago

It also fixed previous behavior when it was removing $ string template handling.