I want to create a snippet that prints the value of a variable for debugging purposes. this is what I came up with:
{
"Debug": {
"prefix": ["db"],
"body": ["console.log(\"$1 :\", $1)"]
}
}
When I use this snippet cursor goes between the quotes ( | is the cursor position):
console.log("| :",)
And after I typed the name of a variable it copies the name to the second parameter:
console.log("name :", name)
But I can't use autocompletion in strings. sometimes the variable is an object and auto-completion helps me pick a specific key of the object. I want the cursor to stop in the second parameter so I can use autocompletion:
console.log(" :", |)
And whatever I type should be copied inside the double-quotes:
console.log("name :", name)
just like the previous example but backward.
How can I do that?
UPDATE: I created an issue: https://github.com/microsoft/vscode/issues/142327