pawelgrzybek / snippet-generator

Snippet generator for Visual Studio Code, Sublime Text and Atom
https://snippet-generator.app/
1.74k stars 202 forks source link

Enhancement : Deal with more reserved characters #9

Closed Clebam closed 6 years ago

Clebam commented 6 years ago

Hey there,

I wonder if there is a way to enhance the generator to deal with some more characters (at least in VSCode)

Like \ or $ (typically to import powershell code)

UNC patch: \\mypath\dir to \\\\mypath\\dir

Variables: $myVar to \\$myVar

Thanks. Great tool!

pawelgrzybek commented 6 years ago

Hi.

I made a few exceptions for very common examples. It is possible to handle more edge cases like presented above, but I'm not that great at RegEx — thats the first one. Second one — there is a ton of edge cases and it is close to impossible to handle them all.

In case of someones good heart the logic of an app is separated per editor. I'm more than happy to accept PRs, but for now I'm not planing to add more exceptions to current patterns.

I still believe that the tool helps a lot to create snippets in no time. I apologise for some of the inconveniences that you experienced.

have a great day and thanks for using snippet generator 🥑

Clebam commented 6 years ago

Thanks for your feedback.

It actually already performs 90% of the job so thanks a lot again ;)