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

Bug 10812

Summary: Templates don't add imports
Product: [Eclipse Project] JDT Reporter: Peter Burka <peter_burka>
Component: TextAssignee: Claude Knaus <Claude_Knaus>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: other   
Whiteboard:

Description Peter Burka CLA 2002-03-05 16:30:57 EST
When I use the 'for - iterate over collection' template, for example, it 
generates code which uses the unqualified type 'Iterator'.

This code will not compile without an 'import java.util.Iterator;' line.  And 
it interferes with content assist.

Templates need some way to add imports, or qualify the names of types used.

(20020215 build)
Comment 1 Erich Gamma CLA 2002-03-07 05:22:49 EST
We have started to add auto import support, i.e., code assist. It is fair that 
users are now expecting it everywhere and it would be cool.

it requires additional infrastructure support that we can't do for 2.0 
Comment 2 Dirk Baeumer CLA 2002-07-23 09:26:13 EDT
Reopening for 2.1 consideration
Comment 3 Claude Knaus CLA 2002-09-09 03:53:47 EDT

*** This bug has been marked as a duplicate of 20424 ***