I am creating a user snippet in vs code for my react development.
I have one transform to extract immediate parent folder name using
${TM_DIRECTORY/^.+\\\\(.*)$/1ドル/}
and another transform to capitalize
"${TM_DIRECTORY/(.*)/${1:/capitalize}/}"
Link : How to get the base directory in visual studio code snippet?
I am still a noob at this so trying to figure out how to extract capitalized immediate parent folder name.
Maaz Ahmad KhanMaaz Ahmad Khan
asked Mar 21, 2021 at 13:46
2 Answers 2
This is what I use here:
${1:${TM_DIRECTORY/^.*(\\/|\\\\)([^(\\/|\\\\)]+)$/${2:/capitalize}/}}
Sign up to request clarification or add additional context in comments.
Comments
Figured it out !
I took help from this How to apply more than on transform on visual studio code snippets?
${TM_DIRECTORY/^.+\\\\(.*)$/${1:/capitalize}/}
answered Mar 21, 2021 at 14:56