cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.45k stars 160 forks source link

Allow the use of @jsweet.lang.Name with classes #317

Open negora opened 7 years ago

negora commented 7 years ago

Hello:

Right now, the @jsweet.lang.Name annotation only can be used with:

In my humble opinion, it would be fantastic if you allowed its usage with classes too. Some JavaScript programmers use class names that start with a lowercase letter, instead of an uppercase letter. This style conflicts with the typical style rules of Java. But, with this annotation, we could rename the class definitions with proper Java names.

For example, the WNumb library uses an interface called wNumbOptions. I would prefer to call it WNumbOptions in Java but, at the same time, keep its original name when transpiling it. Something like this:

@jsweet.lang.Interface
@jsweet.lang.Name (value = "wNumbOptions")
public abstract class WNumbOptions {
...
}

Thank you for your hard work :) .

renaudpawlak commented 7 years ago

Yes. That would be a nice feature but it is not that easy to implement (that why I did not do it)... Let's plan it for a not-too-far future ;)