docblockr icon indicating copy to clipboard operation
docblockr copied to clipboard

JavaScript ES6 support

Open khizarnaeem opened this issue 9 years ago • 22 comments

Any plans for JS ES6 support?

khizarnaeem avatar Nov 26 '15 10:11 khizarnaeem

Specifically support for class methods would be appreciated.

tofagerl avatar Dec 03 '15 10:12 tofagerl

+1

Koleok avatar Jan 05 '16 16:01 Koleok

+1

PEM-- avatar Jan 06 '16 14:01 PEM--

+1

jcbvm avatar Mar 08 '16 10:03 jcbvm

@wassname thanks for those sir, will be helpful in the meantime

Koleok avatar Mar 14 '16 20:03 Koleok

+1 for ES6 support

Kamilius avatar May 19 '16 09:05 Kamilius

How we can implement a solution for this?

diegochavez avatar Aug 01 '16 15:08 diegochavez

+1

simonwidjaja avatar Aug 02 '16 18:08 simonwidjaja

FYI: Version 0.8.0 adds support for ES2015 arrow functions

MoritzKn avatar Aug 09 '16 21:08 MoritzKn

+1

Luchanso avatar Sep 01 '16 19:09 Luchanso

I took all ES2015 features that affect docblockr from this ES2015 feature list:

  • [x] arrows functions
  • [x] Classes ( #267)
    • [x] new constructor syntax (#201)
  • [ ] enhanced object literals
    • [x] Shorthand method definitions (#205, #169)
    • [ ] dynamic property names
  • [ ] destructuring (#180)
  • [ ] rest operator in function params
  • [x] default parameter
  • [x] let + const
  • [x] generators (#36)
  • [x] modules
    • [x] autocomplete for exported objects

MoritzKn avatar Oct 06 '16 22:10 MoritzKn

+1 really annoying not getting ES6 class method blocks.

WalterWeidner avatar Oct 27 '16 21:10 WalterWeidner

+1

jwickens avatar Nov 02 '16 09:11 jwickens

+1

frederickk avatar Nov 13 '16 03:11 frederickk

+1

canastro avatar Dec 03 '16 11:12 canastro

+1

brentstrandy avatar Jan 21 '17 00:01 brentstrandy

+1 Hello. I copied the pattern from java and included in the file /lib/languages/javascript.js This could be useful:


    var classMethodRegex = xregexp(
        // Method name
        '(?P<name1>' + this.settings.fnIdentifier + ')\\s*' +
        // Params
        '\\((?P<args>.*?)\\)\\s*' +
        // # Throws ,
        '(?:throws\\s*(?P<throwed>[a-zA-Z_$0-9\\.,\\s]*))?'
        );

Then


    var matches = functionMatches || arrowFunctionMatches || classMethodMatches;

And voila. But i'm sure there is a better way to achieve this. class-method-regexp

tykoth avatar Jan 23 '17 03:01 tykoth

+1 😄

prometheas avatar Feb 26 '17 02:02 prometheas

+1

Gaffen avatar Mar 13 '17 11:03 Gaffen

Since most of the people commenting here seem to be most interested in support for shorthand method definitions: version v0.9.2 now supports this (again).

MoritzKn avatar Mar 19 '17 17:03 MoritzKn

Just upgrade it .. It will work like a charm . My current version is 0.11.0 .

abdennour avatar Aug 24 '17 02:08 abdennour