Consider the following snippet…
<snippet>
<content><![CDATA[\${${1:someVar}}]]></content>
<tabTrigger>$</tabTrigger>
<description>JS - String Interpolation</description>
<scope>source.js</scope>
</snippet>
The idea is to create a snippet which inserts ${someVar}
into a JS document when you autocomplete on the $
key.
It works fine on its own in a JS document. However whenever it’s within back ticks as required for JS Template Literals it autocompletes to <1></1>
.
For reference it also autocompletes to <1></1>
in single or double quotes.
Why is this happening and more importantly how can I fix the snippet so it autocompletes to ${someVar}
within back ticks?