I'm trying to write a snippet to make case-style statements in JavaScript quicker. Right now I have this, and it works:
"long if-else": {
"scope": "javascript,typescript,html",
"prefix": "ie",
"body": [
"if ( $2 ) {\n\n} ${1/(.)/else if ( ) {\n\n} /g}else {\n\n}\n"
]
}
it allows you to insert 0 or more else if statements in between the opening if and closing else by entering n characters after first tab and hitting tab again.
I would like the user (me) to be able to specify a value to go inside the brackets (like myVar =
). I've tried setting up a variable to be evaluated after the transform, but it hasn't been read as a variable.