wmyywm / eclipse-code-formatter-intellij-plugin

Automatically exported from code.google.com/p/eclipse-code-formatter-intellij-plugin
0 stars 0 forks source link

GWT native methods are not formatted correctly #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
GWT native methods are not formatted properly (JavaScript code inside Java 
files).

Eclipse formats code like this:

    private native JavaScriptObject jsInit() /*-{

        var self = this;

        (function() {
            alert("Hello");
        })();

    }-*/;

IDEA (plugin) formats code like this:

    private native JavaScriptObject jsInit() /*-{

                        var self = this;

                        (function() {
                        alert("Hello");
                        })();

                        }-*/;

Original issue reported on code.google.com by Dmitrijs...@gmail.com on 20 Jun 2012 at 12:35

GoogleCodeExporter commented 9 years ago
do you have any special plugin? because my eclipse formattes like this:

    private native JavaScriptObject jsInit() /*-{

                        var self = this;

                        (function() {
                        alert("Hello");
                        })();

                        }-*/; 

Original comment by vojta.kr...@gmail.com on 20 Jun 2012 at 12:45

GoogleCodeExporter commented 9 years ago
it will be hard, but doable.

Original comment by vojta.kr...@gmail.com on 20 Jun 2012 at 6:00

GoogleCodeExporter commented 9 years ago

Original comment by vojta.kr...@gmail.com on 21 Jun 2012 at 10:42

GoogleCodeExporter commented 9 years ago
fixed in 2.1

Enjoy.

Original comment by vojta.kr...@gmail.com on 22 Jun 2012 at 8:23

GoogleCodeExporter commented 9 years ago
wow, thank you! works perfectly :)

Original comment by Dmitrijs...@gmail.com on 1 Jul 2012 at 12:15

GoogleCodeExporter commented 9 years ago
Do I need to modify anything to make this work?

Original comment by javim...@gmail.com on 11 Apr 2013 at 12:43

GoogleCodeExporter commented 9 years ago
just configure Java and JS config file and tick the checkbox

Original comment by vojta.kr...@gmail.com on 11 Apr 2013 at 12:44

GoogleCodeExporter commented 9 years ago
Wonderful, for future reference in case anybody has the same question.

In IntelliJ  there's an option called:  "Enable GWT native methods formatting".

I had to create a copy of the default eclipse profile, then I selected the 
following file:
org.eclipse.wst.jsdt.core.prefs

Original comment by javim...@gmail.com on 11 Apr 2013 at 12:53