Results 1 to 6 of 6

Thread: STS 3.0.0: Format Bug

  1. #1
    Join Date
    Aug 2012
    Location
    Philippines
    Posts
    7

    Question STS 3.0.0: Format Bug

    Format (Ctrl + Shift + F) under Source menu has bug, specifically in HTML files. I don't know if there is a setting that must be made to format (alignment, tabbing) the codes just like what it does in STS 2.9.2.

    Here is an example, the original code is like this (which is under a script tag, inline javascript):

    Code:
    +"<td><center><img src=\"images/table_delete.png\" width=\"16\" height=\"16\"></center></td>"+"</tr>");
    In STS 2.9.2 the above code will be tabbed correctly:

    Code:
    																	+ "<td><center><img src=\"images/table_delete.png\" width=\"16\" height=\"16\"></center></td>"
    																	+ "</tr>");
    In the case of STS 3.0.0 it looks like this:

    Code:
    																	+ "_$tag_________________________$ta_$tag____$tag_____________________________________________________________________________$tag_____$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag____$tag__________________________________________________________$tag_____$tag_$ta_$tag_________________________$ta_$tag____$tag_____________________________________________________________________________$tag_____$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag____$tag__________________________________________________________$tag_____$tag_$ta_$tag____$tag_________________________$ta_$tag____$tag_____________________________________________________________________________$tag_____$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag____$tag__________________________________________________________$tag_____$tag_$ta_$tag____$tag____________________________________________________________$tag_________________________$ta_$tag____$tag_____________________________________________________________________________$tag_____$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag____$tag__________________________________________________________$tag_____$tag_$ta_$tag____$tag____________________________________________________________$tag_____$tag_________________________$ta_$tag____$tag_____________________________________________________________________________$tag_____$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag____$tag__________________________________________________________$tag_____$tag_$ta_$tag____$tag____________________________________________________________$tag_____$tag"
    																	+ "_$tag_________________________$ta_$tag____$tag_____________________________________________________________________________$tag_____$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag_$ta_$tag____$tag__________________________________________________________$tag_____$tag_$ta_$tag____$tag____________________________________________________________$tag_____$tag_$tag");
    It is just annoying to be like this all the time, all tags are formatted correctly while others are replaced with random spelling of "$tag" and underscores.

    I hope you have an answer for this

  2. #2
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,640

    Default

    Hey!

    This looks a lot like a bug in the HTML formatting code, since the insertion of "$tag" is really strange. Can you attach a sample HTML file that reproduces the problem, so that I can open a bug against the Eclipse WTP for this?

    Thanks!
    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  3. #3
    Join Date
    Aug 2012
    Location
    Philippines
    Posts
    7

    Post

    Thanks sir Lippert for reply. I have attached the sample html files with this post. I have changed the file extension to .txt because your server says html file is invalid for uploading . Kindly change it to html then download the jquery js dependecy for some testing.

    I think this has something to do with the jquery javascript, also, there can be unsupported rulings (like using the $(function(){}) inside Eclipse Juno itself when formatting the codes, specifically in html files...

    Regards,
    atan
    Attached Files Attached Files
    Last edited by atan742; Aug 28th, 2012 at 03:29 AM.

  4. #4
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,640

    Default

    Hey Atan!

    Thanks for the sample files, I created a bug report at Eclipse to get this fixed:
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=388340

    Cheers,
    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  5. #5
    Join Date
    Aug 2012
    Location
    Philippines
    Posts
    7

    Default

    Sir, thanks for the report. I've checked the link you provided. The bug was already fixed but I don't know how to patch the said JsTranslator.java which has the said bug. Is there a download needed or where could I find that JsTranslator.java file in the STS folder?

    -atan

  6. #6
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,640

    Default

    Hey!

    Patching that yourself is a bit difficult, you would need to do quite a lot of stuff. I would recommend to wait for STS 3.1.0, which will be based on Juno SR1 (comes out end of September) where this bug is fixed. If you need the bug earlier, you could try to install an update from one of the nightly builds of WTP. But the easiest way would be to wait for Juno SR1.

    HTH,
    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •