vs code supposedly is supports substation, i.e., transforms, in user-defined snippets. But its working for me only with (built-in) variables and not placeholders.
See the following snippet:
"substitution test" : {
"prefix" : "abc",
"body": [
"${TM_FILENAME}",
"${TM_FILENAME/^([^.]+)\\..+$/$1/}",
"${TM_FILENAME/^([^.]+)\\..+$/${1:/capitalize}/}",
"${TM_FILENAME/^([^.]+)\\..+$/${1:/upcase}/}",
"${2:showMeInAllCapsWhenReferenced}",
"${2/upcase}"
]
}
The output of lines 1-4 is as expected:
users.actions.ts
users
Users
USERS
In line 5 there is a placeholder and I reference it again in line 6. I want it to show both times, once as I type it, and again in all-caps. So e.g.:
fooFoo
FOOFOO
But the actual output is
showMeInAllCapsWhenReferenced
${2/upcase}
Is substitution/transformation of referenced placeholders (as I type) even possible?