Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to associate QuickFixProcessor problemId with EclipseMessager.printFixableError errorId?
How to associate QuickFixProcessor problemId with EclipseMessager.printFixableError errorId? [message #244301] Wed, 06 June 2007 15:08 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: My QuickFixProcessor is never invoked (what handledMarkerType corresponds to APT_QUICK_FIX_PROBL [message #676616 is a reply to message #244394] Sun, 05 June 2011 17:48 Go to previous message
adam  is currently offline adam Friend
Messages: 1
Registered: June 2011
Junior Member
Did you find any resolution to this? I'm also trying to use the QuickFixProcessor even putting what I think is the correct handledMarkerTypes I cant get anything to be called. I think enablement tag is missing/incorrect.

<extension
id="internal.spelling"
name="QuickFixProcessor"
point="org.eclipse.jdt.ui.quickFixProcessors">
<quickFixProcessor
class="com.googlespellchecker.GoogleQuickFixProcessor"
id="com.googlespellchecker.googleQuickFixProcessor"
name="QuickFixProcessor">
<handledMarkerTypes>
<markerType id="org.eclipse.jdt.ui.internal.spelling"/>
</handledMarkerTypes>
</quickFixProcessor>
</extension>
Previous Topic:Getting NoSuchMethodError in runtime.
Next Topic:Debug doesn't hit breakpoint
Goto Forum:
  


Current Time: Thu Apr 18 21:11:48 GMT 2024

Powered by FUDForum. Page generated in 0.02087 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top