Closed ariririos closed 8 years ago
Thank you for this. Testing it now.
I didn't upload it to the extension registry yet, so you have to install from GitHub directly. Let me know if I missed anything. :wink:
@Hirse It works properly for everything I've tried except for functions that are properties of objects. It shows the property name with the function
keyword, but only shows function()
when using an arrow function. But that's probably too much of an edge case considering the new syntax for object methods (which isn't supported, by the way).
The (basic) examples I looked at didn't feature these edge cases, but I am still willing to extend the support if possible. Could you post a code snippet here that contains the mentioned syntax features? That would make it easier for me to test.
Also reopening this issue until I added more.
This code has different behaviors for all three methods:
let obj = {
one: function() {}, //-> one()
two: () => {}, //-> function()
three() {} //-> doesn't show up at all
};
Great work by the way, thanks!
@Hirse By supporting the last case, it seems that you could also support methods on classes, but I'm not sure if you'd want those to show up also.
How can I get this ES6 support?
As I didn't finish all cases, it is not released yet. You can install the current state by installing the extension from GitHub directly. Follow the instruction on the readme under installation.
The title is self explanatory. I understand that you're using regex to determine if a string is a function declaration, and the semantics of arrow functions introduce a high level of complexity, but browsers and JS environments are already starting to support arrow functions natively, so this extension should keep up with that.