0

I try to work with eclipse Neon and JavaScript sadly JSDT seems to be broken in a few ways. I like to use the new ES6 classes like:

class MyClass {
  constructor(name) {
    this.name = name;
  }

  //...

  static getClassName () {
    return 'MyClass'
  }

With this, I get a more or less working outline. What doesn't work anymore is the code formatter. The code just doesn't get formatted.

Is there anything to do to make eclipse format such code?

If not an alternative would be another coding style without class. But I haven't found one where formatting and outline work both. Do you know in which version formatting and outline work?

Fabian
  • 11
  • 4

1 Answers1

1

Eclipse's support for ecmascript is poor. You can try ternjs

http://ternjs.net/

karthick
  • 11,998
  • 6
  • 56
  • 88
  • I tried it only for short while now, but couldn't find anyway to make the formatter work with `class` definitions, but the formatter doesn't seem to be touched at all by ternjs, or? It is definitely nice for having a better autocomplete. – Fabian May 19 '17 at 06:37