Skip to main content

All Questions

1 vote
2 answers
295 views

How to use Regex to 'capitalize and replace' in Visual Studio Code's snippets?

I want to create a snippet on Visual Studio Code . I tried to manually join the Regex but it never worked like my expect: input: idss-static-frame.spec expected result: IdssStaticFrame my Regex: ${...
Zeno Tian's user avatar
5 votes
3 answers
3k views

VS Code Snippet transform: if (regex matches X) { use transform A } else if (regex matches Y) { use transform B }

I'm trying to create a snippet that creates a class name based on the file path. If the file is named index.js, I'd like the class name to take the folder name. Otherwise, use the file name. I've got ...
jabacchetta's user avatar
  • 50.5k