comby-tools / comby

A code rewrite tool for structural search and replace that supports ~every language.
https://comby.dev
Apache License 2.0
2.4k stars 62 forks source link

Typescript/Javascript expressions embedded in template strings not recognized #372

Open jamestelfer opened 11 months ago

jamestelfer commented 11 months ago

Describe the bug JavaScript template strings can include expressions:

const s = `foo ${bar.toString()}`

When using the Javascript or Typescript matchers, these expressions cannot be matched. When using the Generic matcher, it works.

Reproducing

bit.ly/3QEaAfy

Expected behavior

I expect to be able to match on expressions within template strings.

Additional context

It is possible for me to "just" use the Generic matcher when transforming these files, but I'm not sure what other potential issues I might cause myself by doing so, and it makes me wonder whether I should be using the Typescript matcher at all.