facebook

JSP editor: JavaScript "<" and formatting [Clos

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

    b0rg
    Member

    Hi,

    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

    #202519 Reply

    No Operation
    Member

    as 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

    #202531 Reply

    Riyad Kalla
    Member

    This doesn’t just help the editor b0rg, its good practice for ornery browsers.

    #203319 Reply

    b0rg
    Member

    Sorry, 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.

    #203320 Reply

    Riyad Kalla
    Member

    We 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.

    #206518 Reply

    dfini
    Member

    Thanks, this solution is working eventhough if it’s a workaroud.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: JSP editor: JavaScript "<" and formatting [Clos

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