cincheo / jsweet-eclipse-plugin

The official Eclipse plugin for the JSweet transpiler
http://www.jsweet.org
Apache License 2.0
20 stars 10 forks source link

Plugin doesn't support targetVersion #15

Closed diamondq closed 5 years ago

diamondq commented 6 years ago

There is no direct setting (that I can see) for setting the targetVersion on the transpiler. Unfortunately, it's defaulting to ES3. The only mechanism I can see to set the targetVersion is to provide a jsweetconfig.json. Unfortunately, the plugin doesn't provide a proper path, and thus, it falls back to using the 'current working directory', which is a bit of a mess within Eclipse (on my box it happened to be the Eclipse installation directory).

With the default of ES3, all sorts of errors occur when attempting to compile projects like Angular 2, which use directives that are marked experimental. If I can get it up to ES5, then the -experimentalDirectives is automatically added, and everything is happy.

Ideally, it would be great if the JSweetBuilder used the JSweetTranspiler constructor that took a configuration file, and it provided a reference to an (optional) file at the root of the project.

Here's a pull request with that (and an upgrade to the embedded JSweet):

16

Cheers

lgrignon commented 5 years ago

Solved with: https://github.com/cincheo/jsweet-eclipse-plugin/pull/27

And deployed to update site.