When InspectionGadgets tell me that I have a magic number,
I would like to have the intention to replace the magic
number with the appropriate constant.
Let's say I have this code:
Putting the cursor on the first '10' in the Dimension call
and pressing Alt-Enter should present a list with the
- Introduce Constant (same as existing refactoring)
- Use WIDTH (10)
- Use HEIGHT (10)
The choices in the list are those constants whose value
matches the number that is to be replaced.
Can it be done?