VS Code: How to convert snippet placeholder to uppercase or lowercase?

For reference:

The integer in the EBNF docs refers to a RegExp group not to a tabstop reference so should work:

"test": {
    "prefix": "test",
    "body": "${1} -> ${1/(Asdf)/${1:/upcase}/} ${1/(Asdf)/${1:/downcase}/}"
}

Try this:

"test": {
    "prefix": "test",
    // "body": "${1} -> ${1/(.*)/${1:/upcase}/} > ${1/(.*)/${1:/downcase}/}"
    // simpler version below works too
    "body": "${1} -> ${1/(.*)/${1:/upcase} ${1:/downcase}/}"
}

You need to hit Tab to apply the transformation.


Kind of solution:

  "test": {
    "prefix": "test",
    "body": "$1 ${1/(.*)/${1:/upcase}/}  ->  ${1/(.*)/${1:/downcase}/}  ->  ${1/(.*)/${1:/capitalize}/}"
  }

result:

asdF ASDF  ->  asdf  ->  AsdF