Bug 254691 - [quick fix] Quick fix to qualify enum value
Summary: [quick fix] Quick fix to qualify enum value
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-09 08:26 EST by Philipp Kursawe CLA
Modified: 2008-11-11 08:29 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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(..)).