Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333784

Summary: code completion in jsp expressions don't work inside html tags.
Product: [WebTools] WTP Source Editing Reporter: Stu Mising name <spamme>
Component: jst.jspAssignee: jst.jsp <jst.jsp-inbox>
Status: RESOLVED WORKSFORME QA Contact: Nick Sandonato <nsand.dev>
Severity: normal    
Priority: P3 CC: ccc, spamme, thatnitind
Version: 3.2.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Stu Mising name CLA 2011-01-07 15:58:59 EST
Build Identifier: 20100917-0705

Editing a jsp, if you type 
<%=C(ctrl+space) 
you'll get a list of options for code completion starting with C for example. Works great.

If you do the same thing inside an html tag...

<input name="<%=C(ctrl+space)

the code assist box will come up empty.
As long as you close the html tag (with no lingering quotes) it works... e.g.

<input name=><%=C(ctrl+space)




Reproducible: Always

Steps to Reproduce:
1.brand new install of helios j2ee
2.create jsp
3.type <input name="<%=(ctrl+space)
Comment 1 Stu Mising name CLA 2011-01-07 15:59:44 EST
Worked fine in ganymede by the way.
Comment 2 Nick Sandonato CLA 2011-01-10 10:43:45 EST
I have a pretty simple JSP, whose only content under <body> is:

<input name="<%=C| 
I invoked content assist at the |, and got a full list of proposals.

Do you have any other info you could share?
Comment 3 Stu Mising name CLA 2011-01-10 11:07:59 EST
I just noticed, I get the "content assist not available at the current location" message in red on the status line.

Is there some debugging switch I can turn on in eclipse that will log more?
This is really driving me batty, but if it's only me, then when I have time I'll try reinstalling, but it's really a brand new setup. I added the subclipse extension, and that's pretty much it.

New workspace, new everything.
Comment 4 Stu Mising name CLA 2011-01-11 17:13:03 EST
I have a feeling this is going to be a waste of everybody's time.

I noticed that in that same jsp there are places where content assist does work inside an html tag.

I tried it in other jsps though and they have the same problem of "not available at the current location."

I guess you can close this and I'll just suffer unless somebody else comes along and has the same problem. But I have a feeling it's just me.
Comment 5 Nick Sandonato CLA 2011-01-11 18:06:20 EST
Thanks for digging deeper, Stu. We appreciate it! But no one wants you to suffer. So, if you ever come across a scenario that you can break down for us, maybe a particular file or a slimmed-down project, feel free to re-open this bug and attach what you can.
Comment 6 Stu Mising name CLA 2011-01-12 15:01:08 EST
To anybody else who may come across this:
I just installed eclipse for java from scratch, then added the few WTP things I needed to get the jsp editor to come up. Same thing. Some parts of my jsp the code assist works, other parts it does not.

Sure the eclipse j2ee install should yield the same results as the java install with WTP but I thought maybe my install was bad, but they both do the same thing.

I'm sure it has something to do my jsps, especially since it works in later parts of the jsp and not earlier parts.

This did work in galileo (if I said ganymede before I was wrong) so I think maybe something changed, but a vanilla jsp has the same problem...

<%@page import="olc.formbuilder.FBListDefs"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<table>
<tr>
<%-- here it does not work --%>
<td> <input name="<%=FB(ctrl+space) %>">
</table>

<%-- here it works --%>
<%=FBListDefs.APP_DONATIONS %>

</body>
</html>

I dunno.
Comment 7 Stu Mising name CLA 2011-01-12 15:17:12 EST
Now I'm sure I'm not crazy.
I just installed the galileo j2ee build
Build id: 20100218-1602

and pointed it to the same workspace as the helios j2ee and java installs and IT WORKS. As in the code assist now works everywhere in the same jsp file.

So something changed.

For now I'll stick with galileo.

Hope it helps.
Comment 8 Nick Sandonato CLA 2011-01-12 15:54:40 EST
Interestingly, I tried the code you pasted in comment 6 in SR1 of Helios and got the "Content Assist Not Available..." message.

Fortunately, it looks like this has been fixed (I'll have to dig for a bug) in SR2 for Helios.
Comment 9 Nick Sandonato CLA 2011-01-12 15:59:00 EST
(In reply to comment #8)
> Interestingly, I tried the code you pasted in comment 6 in SR1 of Helios and
> got the "Content Assist Not Available..." message.
> 
> Fortunately, it looks like this has been fixed (I'll have to dig for a bug) in
> SR2 for Helios.

Didn't have to dig too hard. Looks like this was fixed by Bug 326336.
Comment 10 Stu Mising name CLA 2011-01-12 16:01:15 EST
Thanks for the follow up, Happy to know I'm not crazy.