How to associate QuickFixProcessor problemId with EclipseMessager.printFixableError errorId? [message #244301] |
Wed, 06 June 2007 15:08 |
Eclipse User |
|
|
|
Originally posted by: myawn.ebay.com
I'm trying to provide quick fix processing for my own annotation types.
I am calling EclipseMessager.printFixableError(pos, message, plugin,
errorId) -- but in that call, errorID is a String value.
In my QuickFixProcessor, hasCorrections passes an in problemId.
How do I associate the errorIds with the problemIds? Do I need to be
defining an IMarker, an IProblem, or something else?
Thanks,
Mike
|
|
|
My QuickFixProcessor is never invoked (what handledMarkerType corresponds to APT_QUICK_FIX_PROBLEM_I [message #244394 is a reply to message #244301] |
Sat, 09 June 2007 00:02 |
Eclipse User |
|
|
|
Originally posted by: myawn.ebay.com
Still not getting this to work, but I've done some more investigation
and maybe this will help someone help me :-)
I'm implementing an org.eclipse.jdt.ui.text.java.IQuickFixProcessor.
It's not clear to me whether this or an IQuickAssistProcessor (in JFace
package) is better, but since I'm specifically working on Java files, I
think this is where I want to be.
I'm trying to process errors flagged during annotation processing using
EclipseMessager.printFixableError().
I found a comment somewhere (in a Javadoc?) that indicates in my
hasCorrections implementation, to see errors recorded in that fashion, I
need to be looking for problemId =
EclipseMessager.APT_QUICK_FIX_PROBLEM_ID. So I have that test in place,
but my hasCorrections method is never being called in order for me to
offer corrections.
In the extension description for org.eclipse.jdt.ui.quickFixProcessors,
it says the following:
"Since 3.2 an extension can specify which problem marker types it can
handle. It will only get problems of these types to process. If no
handled marker type are specified, the processor will only get problems
of types org.eclipse.jdt.core.problem,
org.eclipse.jdt.core.buildpath_problem and org.eclipse.jdt.core.task
(compatible to the behaviour prior to 3.2). "
I think this explains why my hasCorrections isn't being invoked, since
the errors I'm setting via the messager don't fit those types. So I
need to add a <handledMarkerTypes> element into the extension, but I
don't know what string to put there -- is there a defined markerType ID
that corresponds to APT_QUICK_FIX_PROBLEM_ID, or do I create my own ID
(and any pointers there would be appreciated -- I can see that I can
create my own marker type extension, but again don't see how the ID of
that gets associated to the errors being recorded by the annotation
processor).
Mike
|
|
|
|
Powered by
FUDForum. Page generated in 0.02087 seconds