Bug 161030 - add code assist for enum values
Summary: add code assist for enum values
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.4 M7   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-16 07:05 EDT by Martin Aeschlimann CLA
Modified: 2008-04-29 02:55 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix (28.71 KB, patch)
2008-04-16 06:57 EDT, David Audel CLA
no flags Details | Diff
Better fix (31.12 KB, patch)
2008-04-16 07:17 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2006-10-16 07:05:08 EDT
20061016

Code assist should suggest enum values when possible.
In the following code, the user completes an method argument that needs to be of type 'enum E'.
The top suggestion should be: E.E1, E.E2, E.E3...
For example they should be: ElementType.TYPE, ElementType.FIELD, ElementType.METHOD...

----
package p;
public class A {
	enum E {
		E1, E2, E3
	}

	public void foo(E e) {
	}
	public void bar() {
		foo(E| code assist here: Expected: E.E1, E.E2, E.E3
	}
}
--- example 2
@Target(| code assist here: Expected: ElementType.TYPE, ElementType.FIELD...

public @interface K {

}
Comment 1 David Audel CLA 2008-04-16 06:57:01 EDT
Created attachment 96243 [details]
Proposed fix
Comment 2 David Audel CLA 2008-04-16 07:17:32 EDT
Created attachment 96244 [details]
Better fix
Comment 3 David Audel CLA 2008-04-16 07:19:55 EDT
Released for 3.4M7.

Tests added
  CompletionTests_1_5#test0364() -> test0366()

Tests updated
  CompletionTests_1_5#test0136() -> test0142(), test0208(), test0265()
Comment 4 Eric Jodet CLA 2008-04-29 02:55:24 EDT
Verified for 3.4M7 using I20080427-2000.