Bug 113345 - [content assist]Import completion
Summary: [content assist]Import completion
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 0.7.1   Edit
Hardware: PC Windows XP
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Sarika Sinha CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2005-10-21 08:49 EDT by Dan Watling CLA
Modified: 2010-11-29 08:34 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Watling CLA 2005-10-21 08:49:09 EDT
I am not sure if this is the right component to assign this enhancement request
to. If it isn't I apologize.

My request is that I'd like to see import completion when editing JSPs. It'd be
nice to have that consistency among JSPs and Java files.
Comment 1 Phillip Avery CLA 2005-10-21 09:01:56 EDT
Is that the same as bug 86656?
Or did you mean something different?
Comment 2 David Williams CLA 2005-11-12 01:18:35 EST
Let's put in JSP component, and no, Phil. I suspect this is more similar to the
"organize imports" ... and/or that Java editor will insert whole (new) import
statement if you complete a classname. 

So, for example, 
you could name just a class in <jsp:useBean class="|">
and an appropriate <%@page import="|"%> 
be inserted at the top of the page. 

We considered this before, but quickly gave up since it requires multiple Edits
to be create, applied, translated ... and its all has to be pretty smart
(several "round trips" to and from translated java to original JSP source ...
maybe in 1.5? 

Comment 3 Phillip Avery CLA 2006-01-11 16:46:09 EST
I coded up part of this (already in HEAD)
If you content assist in 

<% List| %>

an import will be added for:

<%@page import="java.util.List"%>

after the document root element.

<jsp:useBean class="|"> uses a different content assist processor, so I'll have to fix that too.

On a related note, I also added completion for <%@page import="java.uti|"%>, where package names and Types will be proposed.

Comment 4 Nitin Dahyabhai CLA 2007-09-13 05:08:30 EDT
This is still an interesting idea, but we don't have people to work on this just now.  We would accept high quality patches, though.
Comment 5 Ian Tewksbury CLA 2010-04-05 13:32:18 EDT
This is done in WTP 3.2. to some extent.  If you use content assist to insert a Java class in a JSP then the needed import is automatically added.  There is also content assist in the case of:

<%@page import="java.util.|" %>
Comment 6 Sarika Sinha CLA 2010-11-26 01:24:56 EST
Hi Dan,
Analyzing the current support of content assist in jsp files, can you please elaborate on what else do you feel should be added?

Currently the three cases stated here is supported by content assist in WTP3.2:
1. <% List| %>
2. <jsp:useBean class="|">
3. <%@page import="java.util.|" %>
Comment 7 Dan Watling CLA 2010-11-29 07:49:35 EST
I didn't realize this bug was still open!

From what I recall the main use case for me was #3. Personally, I would consider this bug resolved.

-Dan

(In reply to comment #6)
> Hi Dan,
> Analyzing the current support of content assist in jsp files, can you please
> elaborate on what else do you feel should be added?
> 
> Currently the three cases stated here is supported by content assist in WTP3.2:
> 1. <% List| %>
> 2. <jsp:useBean class="|">
> 3. <%@page import="java.util.|" %>
Comment 8 Nick Sandonato CLA 2010-11-29 08:34:18 EST
Resolving based on submitter's comments. Thanks!