Community
Participate
Working Groups
Whenever I format the following text in a JSP, it breaks the javascript code: <script TYPE="text/javascript"> <!-- var myVar = <%= otherVariable %>; --> </script> After formatting the above code, it looks like this: <script TYPE="text/javascript"> <!-- var myVarotherVariableiable %> ; --> </script> I noticed if I removed the <!-- --> comment tags, the formatter still doesn't format the code properly. The script tags and variable are moved to a new line: <script TYPE="text/javascript"> var myVar = <%=otherVariable%> ; </script> This occurs when formatting a .jsp page. Didn't notice this until testing a page and received javascript errors. Luckily my undo history was large enough to recover the code. Eclipse Luna
I am not sure if this is a JSP issue or a JavaScript issue- I will send it to JSP first.
The initial problem, when the comment tags are in place, looks to be a translation problem on our behalf. It looks like somehow the length of the comment start tag isn't being taken into account when setting up the offset mapping between the translation and JSP document. The odd formatting when you remove the comment tags looks to be a JSDT problem. So you would want to open up a separate defect with them.
Nitin reports this is a LOT of work to do during triage session in dev call on 05/24. Downgrading from critical since it's been in queue for 4 years.