Community
Participate
Working Groups
I recently just configured Javascript formatting for Eclipse. Unknowing that there could be a bug, I used ctrl+shift+f on a web page where I had implemented some javascript validation code. I saved, deployed, and noticed I was getting strange Javascript errors. I came back to my code in eclipse and noticed that parts of the Javascript code had been deleted and in places where I had Struts tags, it was printing ___$tag_____ in random locations. I have pulled the archived code from a previous deployment to restore, and I notice that when I do ctrl+shift+f on a large chunk of javascript, it deletes my code. Sometimes, but not every time, it will replace some code with $___$tag____. It seems to occur only when I format a large chunk of code. If I do one or two functions, it works fine. If I highlight all of my Javascript, it deletes code every time. I have around 200 lines of Javascript. I have not experience any crashes, just loss of code. -- Configuration Details -- Product: Eclipse 1.5.0.20120131-1544 (org.eclipse.epp.package.jee.product) Installed Features: org.eclipse.platform 4.2.0.v20120608-135145-9JF7BHV8FyMteji0Oi_ePMz0xuZ8TVo7lV0z0ecb
I've narrowed this down further and have been able to work around the issue by not using struts tags within the Javascript. I can just create separate functions and write the logic tags within the html, rather than within the Javascript. It's more code, and may be a bit harder to maintain, but it makes the code more readable and solves the formatting issue.
*** This bug has been marked as a duplicate of bug 382474 ***