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

Bug 330641

Summary: [templates] variable 'iterable' should also include member scope fields
Product: [Eclipse Project] JDT Reporter: thomas menzel <tmenzel>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P5 CC: arrg.ch, daniel_megert, manuel.bork
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description thomas menzel CLA 2010-11-19 04:05:49 EST
i happily use the foreach template but what bothers me is that it doenst include fields on the class in the list of suggestions. that would be really great!
Comment 1 Dani Megert CLA 2010-11-19 07:47:47 EST
NOTE: You could implement your own variable resolver and use that one in the template.
Comment 2 Thomas Girard CLA 2013-08-20 08:27:04 EDT
The doc states that ${iterable} "Evaluates to a proposal for an iterable or array visible in the current scope.".

Here: http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Fconcepts%2Fconcept-template-variables.htm

So either the code or the doc needs fixing.

It seems that most 'simple' variables (iterable, array, collection, etc.) behave this way (suggest only locals). 

The 'complex' variable ${id:var(type)} works on all scopes.
Comment 3 Manuel Bork CLA 2013-11-04 08:51:37 EST

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