Eclipse Quick Fix != Quick Assist
If there’s an error in your java code, Eclipse sticks a marker in the gutter with a light-bulb icon. Clicking on the marker or pressing Ctl+1 with the cursor in the offending line brings up a helpful pop-up of suggested fixes for the problem.
I’ve always assumed that this was called Quick Fix. If you right click on the marker, the option is labelled Quick Fix. However, after struggling for a long while to understand why some Quick Fix code I wrote wasn’t showing up in this menu, I’ve come to the conclusion that this is actually Quick Assist and that the label is wrong (I’ve flagged this as a bug).
To launch Quick Fix you need instead to right click on a Warning/Error in the Problems View. Quick Fix and Quick Assist are in fact two different things with confusingly similar names and functionality.
Internally appropriate Quick Fixes are calculated by a class implementing IMarkerResolutionGenerator that extends org.eclipse.ui.ide.markerResolution. The fixes themselves are contained in classes implementing either IMarkerResolution or IMarkerResolution2. By contrast, Quick Assists are calculated by a class extending org.eclipse.jdt.ui.quickAssistProcessors and implement IQuickAssistProcessor. The classes containing the assists implement IJavaCompletionProposal.
So, if you’re developing a plug-in and cannot work out why your Quick Fixes are not showing up, take a closer look. Maybe like me you’re checking in the wrong place and what you meant to write was actually a Quick Assist.
October 13th, 2006 at 8:48 am
Hi,
I am working on eclipse. I have implemented Quick Fixes for my plugin. However, I donot want to extend my class from org.eclipse.jdt.ui.quickAssistProcessors to implement quick assist. Rather if i only implement IQuickAssistProcessor, can’t i achieve the same functionality as that of the quick assist in my plugin? What class i can extend other than the “jdt” class.
thanks in advance.
regards,
abhijit.
October 22nd, 2006 at 9:23 pm
Sorry Abhijit but I don’t know the answer off the top of my head and don’t have time to look into it right now. Best of luck finding an answer elsewhere.
May 19th, 2008 at 1:36 pm
Hi, can you send me an code example of your “quick assist” example?
I really had the same problem you had. I thought quick fixes are quick assists.
Thank you
May 27th, 2008 at 11:22 am
Hi,
Do you know if it’s possible to customize the quick fix Dialog ?
The standart Dialog is implemented by MarkerResolutionDialog.java in org.eclipse.ui.views.markers.internal package and I would like have my own quick fix Dialog.
Is there an extension point (or an other way) which allow to do that ?
Thanks
Guillaume
May 29th, 2008 at 7:39 pm
Hi Guillaume, I emailed Enduro direct and forgot to post my response to his question here as well.
It’s been a very long time since I played with Eclipse and assuming I ever would have been able to help with requests (and I may not have known the answers then), unfortunately I definitely cannot do so now. I hope you find your answers elsewhere.