Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Quick Fix, Quick Assist

Hello,

How does CDT distinguish between Quick Fixes and Quick Assists? 
There are two separate extension points with similar interfaces: IQuickFixProcessor and IQuickAssistProcessor.

My initial guess was that Quick Fixes are meant to be placed on problems while Quick Assists can be used everywhere. However, I noted that both of them are actually proposed everywhere on Ctrl+1 (both on problems and regular text). Additionally, there is a separate CDT extension point for "marker resolutions", which -in turn- appear only on markers.

Clearly there is some distinction between QF and QA, but how is it defined and expected to work?

~~~

Another matter besides Ctrl+1 is what is proposed when hovering over a problem. This is a relevant screenshot: http://imgur.com/4o4hw

BTW- if I hit ctrl+1 in that place, my contributed dummy Quick Assist extension was proposed, but a dummy Quick Fix wasn't. And the hover proposes none of the two.

On Codan problems (or everywhere in correct code), ctrl+1 proposes both Quick Assists and Quick Fixes. Hovers don't propose anything.

The following code is called when determining fixes while hovering over a problem:

org.eclipse.cdt.internal.ui.text.c.hover.ProblemHover.ProblemInfo.getCAnnotationFixes(ICAnnotation)

82 if (!SpellingAnnotation.TYPE.equals(cAnnotation.getType()))
83 return NO_PROPOSALS;

Basically it was hard-coded for the hovers to ignore all proposals besides spelling proposals (if any), and this seems to apply to all instances of ICAnnotation. Strange! Is there any reason for that to stay in the code?

On top of that, commenting out those two lines still won't make the contributed QA or QF to appear in the hover. I'll continue diagnosing that.

~~~

Short summary:

The behaviour of Quick Assists and Quick Fixes seems inconsistent to me at the moment. While debugging and verifying, I'd like to be able to determine if QF and QA are proposed correctly.

For that, I need complete by-design answers to:

- In what situations shall Quick Fixes be proposed?
- In what situations shall Quick Assists be proposed?

And to keep things clear, I'm referring to extensions of org.eclipse.cdt.ui.quickFixProcessors and quickAssistProcessors extension points respectively.

Best regards,
-- Tomasz Wesolowski

Back to the top