Wikunia / brackets-FuncDocr

FuncDocr generates JS/PHPDoc annotations for your functions
101 stars 14 forks source link

Support for ES6 arrow functions (=>) #66

Closed patrickfatrick closed 8 years ago

patrickfatrick commented 8 years ago

Similar to https://github.com/Wikunia/brackets-FuncDocr/issues/64 but wanted to make a new issue for this.

https://babeljs.io/docs/learn-es2015/#arrows-and-lexical-this

Examples:

obj.function1 = x => {
// do stuff
}

obj.function2 = (x, y) => {
//do some other stuff
}

obj.function3 = () => {
//do some other other stuff
}

Thanks!

Wikunia commented 8 years ago

Thanks for the issue! I'll work on that later today

Wikunia commented 8 years ago

Would be great if you can install from url before I register the new version. Thanks ;)

patrickfatrick commented 8 years ago

Thanks so much for looking at this so quickly. Examples 1 and 2 look great to me from a bit a of testing (I also noticed it works with let and const which is awesome); example 3, which is valid ES6 syntax to declare a function with no arguments, doesn't match. Here's some more information in case it's helpful! https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

Wikunia commented 8 years ago

Now it should be fixed :D