- This topic has 5 replies, 4 voices, and was last updated 20 years, 8 months ago by dfini.
-
AuthorPosts
-
b0rgMemberHi,
Eclipse 2.1.2, MyEclipseIDE 2.7 RC2, WinXPprof, Sun JDK 1.4.2_03
Besides the shift to left/shift to right problem in JSP editor (a showstopper for me), the JSP editor reacts on the “<” character inside JavaScript code and recognizes it as the begin of a HTML tag. For example, in the code snippet below, starting in line 67 with the “10”, the code is marked red.
Also, you can see how the formatter formats the code, very weird.
58 <html> 59 <head> 60 <link rel="stylesheet" type="text/css" href="common/global.css"> 61 <script language="JavaScript" src="common/common.js"> 62 </script> 63 <script language="Javascript"> 64 function test() 65 { 66 var int i = 0, j = 0; 67 for (i = 0; i < 10; ++i) { 68 j += i; 69 } 70 } 71 </script>
b0rg
PS
Although I installed 2.7RC2 (downloaded on 15th of January), it says it is:MyEclipse Application Server Tooling
Version: 2.6.200
Build id: 200312091200-2.7-RC1
No OperationMemberas often mentioned, use HTML comments:
63 <script language="Javascript"> 64 //<!-- 65 function test() 66 { 67 var int i = 0, j = 0; 68 for (i = 0; i < 10; ++i) { 69 j += i; 70 } 71 } 72 //--> 71 </script>
NOP
Riyad KallaMemberThis doesn’t just help the editor b0rg, its good practice for ornery browsers.
b0rgMemberSorry, but “ornery” browsers aren’t our target. Users won’t even reach those pages without JS enabled browsers…
I don’t like the workaround… but, I can live with it, at least for a while.
Riyad KallaMemberWe can definately understand that the existing workaround is suboptimal for very focused developers like yourself (e.g. your team knows exactly who the target audience is and doesn’t need to bother with other contingency cases). We are focusing, as Scott mentioned, on opening up some of the editors rules and behaviors so not having things like quotes in this situation will be handled better.
I believe we are shooting for the 2.8 release for these enhancements; for the time being, we appologize for the inconvenience.
dfiniMemberThanks, this solution is working eventhough if it’s a workaroud.
-
AuthorPosts