Bug 254691

Summary: [quick fix] Quick fix to qualify enum value
Product: [Eclipse Project] JDT Reporter: Philipp Kursawe <phil.kursawe>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, markus.kell.r
Version: 3.5   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Philipp Kursawe CLA 2008-11-09 08:26:02 EST
In the following Scenario where
enum States { State1, State2, };

and I enter this code somewhere
States state = [CTRL+Space]
it should display the values of "States" and insert "States.[selected States]" into the code.

Furthermore when I type
States state = States2;

The QuickFix should be able to resolve "States2" to "States.State2" cause it knows the type of "state". Could that be done? Maybe I could even implement the patch myself but I have no point of reference how to implement such QuickFix Proposal or ContentAssist contribution.
Comment 1 Dani Megert CLA 2008-11-11 06:20:51 EST
>it should display the values of "States"
This works for me using 3.5 M3.


>Maybe I could even implement the
>patch myself but I have no point of reference how to implement such QuickFix
Markus or Martin, please give some hints.
Comment 2 Markus Keller CLA 2008-11-11 08:29:13 EST
>Maybe I could even implement the
>patch myself but I have no point of reference how to implement such QuickFix

This could be added to org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor#getVariableProposals(..) (probably ends up in addSimilarVariableProposals(..)).