russ-p / veloeclipse

Automatically exported from code.google.com/p/veloeclipse
Other
0 stars 0 forks source link

JSP format - Improper indentation when Java generics encountered #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create JSP file with declarations using java generics (
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by Van.Lept...@gmail.com on 18 Feb 2009 at 4:45

Attachments:

GoogleCodeExporter commented 8 years ago
(hit enter in error, issue created prematurely)

What steps will reproduce the problem?
1. Create JSP file with declarations using java generics (see 
JspIndentationExample.jsp
2.Open with Veloeclipse
3.Right click in program text and select format
4. Click "OK"
What is the expected output? What do you see instead?
 I expect something like:
<%@ page import="java.util.*"%>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <title>Insert title here</title>
    </head>
    <body>
        <%
        Map map_without_classes_1 = new HashMap();
        Map<String,String> map_with_classes_1 = new HashMap();
        Map map_without_classes_2 = new HashMap();
        Map<String,String> map_with_classes_2 = new HashMap<String,String>();
        Map map_without_classes_3 = new HashMap();
        %>
</body>
</html>

I got:

<%@ page import="java.util.*"%>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <title>Insert title here</title>
    </head>
    <body>
        <%
        Map map_without_classes_1 = new HashMap();
        Map<String,String> map_with_classes_1 = new HashMap();
            Map map_without_classes_2 = new HashMap();
            Map<String,String> map_with_classes_2 = new HashMap<String,String>();
                    Map map_without_classes_3 = new HashMap();
                    %>
</body>
</html>

What version of the product are you using? On what operating system?
Veloeclipse 2.0.7 on Eclipse 3.4.1-M20080911-1700

Please provide any additional information below.

Original comment by Van.Lept...@gmail.com on 18 Feb 2009 at 4:51

GoogleCodeExporter commented 8 years ago
Confirmed.  I'll take a quick glance at this, but I would consider JSP 
functionality more legacy then anything else 
(as you can tell).  I think most of the JSP handling was copied over 
pre-generics.  I think JSP editing is really 
better served by a dedicated plugin.  Yea, I know, the home page mentions JSP, 
that needs to be fixed.

Original comment by byron.foster@gmail.com on 18 Feb 2009 at 10:24

GoogleCodeExporter commented 8 years ago
I was using the Veloeclipse JSP editor because it seems to be a bit better at 
catching unmatched HTML tags than the standard Eclipse JSP editor. I was hoping 
that 
the formatter would make my life a bit easier, but it's no big deal. You can 
put set 
the priority to low.

Original comment by Van.Lept...@gmail.com on 18 Feb 2009 at 11:22

GoogleCodeExporter commented 8 years ago
The parser Interprets the '<' and '>' in generic definitions as xml characters, 
and indents accordingly. Kind of a 
PITA to fix.  I' going to leave this on low priority for now.

Original comment by byron.foster@gmail.com on 20 Apr 2009 at 10:18