7

I am using Eclipse Mars with the Tern IDE für ES6 support on version 1.1.0 (the snapshot). I get validation errors on arrow functions and const-exports as can be seen in this screenshot:

enter image description here

I worked through these descriptions but the errors won't vanish: https://github.com/angelozerr/tern.java/wiki/Tern-&-ECMAScript6-support https://github.com/angelozerr/tern.java/wiki/Tern-Linter

I don't know however whats really supported by the Tern plugin, but according to the documentation on http://ternjs.net/ Tern should support arrow functions since 0.14. The IDE-page on github however only mentions class, import and promise support (which is beyond basic in my eyes for a plugin to support ES6).

Is there anyone who is developing ES6 with Eclipse with (more or less) full feature support? I kinda feel like a unicorn...

Ahab
  • 676
  • 1
  • 7
  • 15
  • > only mentions class, import and promise support (which is beyond basic in my eyes for a plugin to support ES6). @Ahab ternjs supports more ES6 features like ES modules, etc. See https://github.com/ternjs/tern/issues/116#issuecomment-131781238 I had no time to update the wiki with thoses features, any help are welcome to update the wiki. – Angelo Nov 02 '15 at 14:50

1 Answers1

9

Your error comes from JSDT Validator which doesn't support ES6 syntax (and not from tern).

tern 1.1.0-SNAPSHOT provides support for ES6 for completion, hyperlink, validation but not for ES6 validation. The linter https://github.com/angelozerr/tern.java/wiki/Tern-Linter is a type checker validator and not a syntax validator.

To validate ES6 with Eclipse IDE & tern.java, you must:

Angelo
  • 2,027
  • 13
  • 17
  • Thanks a lot so far! I in deed did the approach with switching to an "External Builder/Validator" but the nature still kept the errors somehow, removing the nature ultimately switched off the validation. – Ahab Nov 03 '15 at 10:59
  • @Ahab could you add a comment at https://bugs.eclipse.org/bugs/show_bug.cgi?id=472754 with your problem with "External Builder/Validator" Thanks! – Angelo Nov 03 '15 at 14:58
  • I added a comment on your linked bug report. Maybe you could implement some kind of validation include/exclude functionality? Validation on JSHint takes forever although I excluded my node_modules from build path of JSDT initially. – Ahab Nov 10 '15 at 12:20
  • For Validation on JSHint, please create issues at https://github.com/angelozerr/tern.java/issues and please share your project which caues problem. – Angelo Nov 11 '15 at 14:02