maddog986 / autodocblocker

Auto generated docblocks using regex. Multiple languages supported.
GNU General Public License v3.0
6 stars 4 forks source link

Support More Vue Functions #3

Open RiFi2k opened 5 years ago

RiFi2k commented 5 years ago

With just two super small tweaks I was able to get it to support mostly all Vue function syntax. It thinks the function name is something random, but overall solid.

Just needed to add and remove some whitespace after the name and function groups.

(?:(?<modifier>(?:local|protected|private|public|const|static|\s)+)\s)?(?:(?<function>[$\w.:*]+)\s)(?:(?<name>[$\w.:]+))\((?<args_full>.*)\)
(?:(?<modifier>(?:local|protected|private|public|const|static|\s)+)\s)?(?:(?<function>[$\w.:*]+)\s?)(?:(?<name>[$\w.:]+)\s?)\((?<args_full>.*)\)

Nothing does Vue doc comments, like nothing! Yours actualy does a pretty good job considering it is not at all really made for them.

https://regex101.com/r/o1qngQ/9

maddog986 commented 5 years ago

Looks awesome! I will try to add more ES6 style sytanx soon.

RiFi2k commented 5 years ago

Honestly the more I look at your extension the more I think its the greatest, with a little work you could go far.

The fact you can edit a config for your docblocks is genius!

This should probably be seperate issue but is it possible to add the config to package.json instead of another dot file?

maddog986 commented 5 years ago

I like that idea. Please open another issue so it doesn't get lost.

maddog986 commented 5 years ago

Better JavaScript/ES6/Vue support coming in 1.0.3

maddog986 commented 5 years ago

I'm going to reopen this ticket as im testing a new regex for functions and was hoping for some other input. https://regex101.com/r/dVLkEP/9 If anyone finds anything that slips through please let me know.

RiFi2k commented 5 years ago

Not sure if your going for vue + typescript syntax support or not right now. If not this looks awesome as it stands to me.

If yes then you may want to grab the return value in this instance https://vuejs.org/v2/guide/typescript.html

greeting(): string {
maddog986 commented 5 years ago

My goal is to make a single regex function that supports as many languages as possible. As Vue is extensionally JavaScript the regex function should support most of it, but i will work on improving Typescript support... it shouldn't be to difficult to add it.

RiFi2k commented 5 years ago

Also make sure you add a tag or multiple tags on the extension for Vue, I know a ton of people are looking for anything to help with vue and docs.

maddog986 commented 5 years ago

Can you give me an example of what your talking about?

RiFi2k commented 5 years ago

Your extension doesn't have Vue listed in the title or more than one time in the README so I would suggest adding some keywords to cover what you support.

Here is the line from my extension I have just left it blank because it already does really well in VSCode searches for what it accomplishes. It took me a bit to find yours.

https://github.com/RiFi2k/format-html-in-php/blob/master/package.json#L20

maddog986 commented 5 years ago

Oh tags in this addon. Gotcha.