Closed coder054 closed 5 years ago
Ha, that figures. So, you’re writing code with the tab targets, and then turn it into a snippet? Didn’t think of that... 🤔
Ok, the idea here is that by default your selected code should be returned by the snippet "as is". We really can't tell if your $1
is just a dollar sign followed by a number, or if you intend for it to be turned into a tab target. It's probably the latter, but it's hard to be certain. So, right now, you'd have to edit the snippet after creation to remove the escapes. The snippet opens after creation, so you could also change your code to add the tab targets then. But I'll look into adding an argument to the command so you can opt-out of the default behavior.
Hi guys!
I too might have encountered this. I did this:
const $1 = require("async/$1")
The result is const \$1 = require("async/\$1")
I can see how this would be useful, for example, if people use $
like they do with jQuery. In some languages I think ALL the variables use $
as a prefix.
I'll take a look at the source and see how difficult it would be to put in a setting.
So the defaults are always escape
? I think this is better, and then user can add $1 and $2 inside of the XML file.
Should this be closed?
Well, that’s not so much the default as it’s the only behavior. It’s the correct behavior though. This issue is open because we might want to add a setting or something.
Is someone already working on this? I'm willing to implement it.
That would be great, I really don’t have the time to do it. 👍🏻
Done! @coder054 sorry for being late a few months :stuck_out_tongue:.
When I create a snippet like this console.log($1) I want "$1" is the place where my cursor is at after the snippet triggered But now "$" is escaped so its turn into a string I don't want that :(