skallin / google-plugin-for-eclipse

Automatically exported from code.google.com/p/google-plugin-for-eclipse
Eclipse Public License 1.0
0 stars 0 forks source link

Editor stops formatting when assigning JSNI callback to JS var #223

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

See the code sample here: https://gist.github.com/carchrae/5976820 (also 
attached)

What is the expected output? What do you see instead?

Code formatting stops working when you assign a JSNI callback with a Java 
argument to a JS var, eg

   var testMethodStr = @bug.FormatBug::testMethodString(Ljava/lang/String;);

Once you comment out this line, then formatting works again.

What version of the product are you using? On what operating system?

Google Plugin for Eclipse 3.7 3.2.4.v201306061638-rel-r37

also confirmed on Eclipse 4.2 by Colin Alworth

Please provide any additional information below.

I have not been able to make a small test case, but I also see the formatter 
applying the Java block comment /* */ rule to my JSNI code.  I believe the 
above issue may be related to this.

Original issue reported on code.google.com by carch...@gmail.com on 11 Jul 2013 at 4:25

Attachments:

GoogleCodeExporter commented 9 years ago
Also, code completion for JSNI methods seems at least partially broken after 
the formatting issue has occured.  eg, completion using tab and JSNI method @co

Original comment by carch...@gmail.com on 11 Jul 2013 at 4:35

GoogleCodeExporter commented 9 years ago
workaround:

        var f = function() {
            @bug.FormatBug::testMethodString(Ljava/lang/String;)(arguments);
        }

Original comment by carch...@gmail.com on 11 Jul 2013 at 5:34

GoogleCodeExporter commented 9 years ago
interesting - it seems that it only breaks a single JSNI method if it contains 
those conditions - others in the same file still format correctly.

Original comment by carch...@gmail.com on 11 Jul 2013 at 5:40

GoogleCodeExporter commented 9 years ago

also, broken - invocations like this (i think this is simply having a JS 
function as an argument - creating an intermediate var fixes it) 

 @bug.FormatBug::testMethodString(Ljava/lang/String;)(String('hello'));

Original comment by carch...@gmail.com on 11 Jul 2013 at 5:44