1

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.

asked Mar 21, 2021 at 13:46

2 Answers 2

0

This is what I use here:

${1:${TM_DIRECTORY/^.*(\\/|\\\\)([^(\\/|\\\\)]+)$/${2:/capitalize}/}}
answered Sep 22, 2023 at 16:58
Sign up to request clarification or add additional context in comments.

Comments

-1

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

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.