facebook

Formatting bug for GWT code

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #282634 Reply

    mviens
    Member

    There is a formatting bug when MyEclipse formats GWT native-style code. The setting is:
    Window / Preferences / Java / Code Style / Formatter / Edit / Indentation – “Declarations within class body”

    If this is on (checked), everything formats correctly except GWT native methods. Every format (which for my team is also set up to occur during save), it inserts a single space at the beginning of each GWT (non-Java) line. If the setting is off (unchecked), every format/save deletes a single sapce from each of the line(s). It should leave it alone, or format it according to the other code rules. Below is an example:

    First format
    ------------
      public static native boolean isHidden(Element elem) /*-{
        return (elem.style.visibility != 'hidden');
      }-*/;
    
      public static native void setHidden(Element elem, boolean hidden) /*-{
        elem.style.visibility = hidden ? 'hidden' : 'visible';
      }-*/;
    
    
    Second format
    -------------
      public static native boolean isHidden(Element elem) /*-{
         return (elem.style.visibility != 'hidden');
       }-*/;
    
      public static native void setHidden(Element elem, boolean hidden) /*-{
         elem.style.visibility = hidden ? 'hidden' : 'visible';
       }-*/;
    
    
    Third format
    ------------
      public static native boolean isHidden(Element elem) /*-{
          return (elem.style.visibility != 'hidden');
        }-*/;
    
      public static native void setHidden(Element elem, boolean hidden) /*-{
          elem.style.visibility = hidden ? 'hidden' : 'visible';
        }-*/;
    
    
    Fourth format
    -------------
      public static native boolean isHidden(Element elem) /*-{
           return (elem.style.visibility != 'hidden');
         }-*/;
    
      public static native void setHidden(Element elem, boolean hidden) /*-{
           elem.style.visibility = hidden ? 'hidden' : 'visible';
         }-*/;
    
    
    Fifth format
    ------------
      public static native boolean isHidden(Element elem) /*-{
            return (elem.style.visibility != 'hidden');
          }-*/;
    
      public static native void setHidden(Element elem, boolean hidden) /*-{
            elem.style.visibility = hidden ? 'hidden' : 'visible';
          }-*/;
    

    This is just a small example. Imagine a very large file. This affects us when checking in modified code, because the differences show up when doing a compare at check-in time. I know this may be a small bug for some people, but it does affect us. We have about 15 licences.

    I would really like to see this resolved in the 6.02 release. Any chance of that happening?

    Mike Viens

    #282690

    Loyal Water
    Member

    Mike Viens,
    I’ll file this right away and try to get it fixed for the next release.

    #282694

    Loyal Water
    Member

    Hi Mike,
    I just checked with the dev team and it seems like this issue is related to the fact that GWT is not supported at the moment. You should file this bug with the Eclipse team specifically.

    #282715

    mviens
    Member

    Thanks Nipun. Here is a link to the Eclipse bug.

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=222083

    #282741

    Loyal Water
    Member

    Thanks for posting the link. I’ll stay on top of it and let the dev team know when it gets fixed.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Formatting bug for GWT code

You must be logged in to post in the forum log in