Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » APT and QuickFixes
APT and QuickFixes [message #259417] Tue, 07 April 2009 13:43 Go to next message
Eclipse UserFriend
Hi,

I'm using Java 5 annotation processors to report errors in my code, and
I have a quick fix processor that suggests corrections. Everything is
working fine, until I disable "Allow annotation processing in editor".
Then, my quick fixes are not showing up any more. After some
investigation, I realized that reporting errors during Reconcile creates
text annotations of type
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocume ntProvider$ProblemAnnotation,
whereas reporting the same errors in the same way during Build produces
text annotations of type org.eclipse.ui.texteditor.MarkerAnnotation.
While the former are IJavaAnnotation and are processed correctly in
collectProposals() at line 263 in JavaCorrectionProcessor, the latter
are not, and seem to go unnoticed to my quick fix processor.

Is there anything I'm doing wrong, or is there a bug here?

Cheers,
J.-P.
Re: APT and QuickFixes [message #259491 is a reply to message #259417] Wed, 08 April 2009 22:52 Go to previous messageGo to next message
Eclipse UserFriend
"J.-P. Pellet" <jpp-mac@gmx.net> wrote in message
news:grg3b5$3gt$1@build.eclipse.org...
> Hi,
>
> I'm using Java 5 annotation processors to report errors in my code, and I
> have a quick fix processor that suggests corrections. Everything is
> working fine, until I disable "Allow annotation processing in editor".
> Then, my quick fixes are not showing up any more. After some
> investigation, I realized that reporting errors during Reconcile creates
> text annotations of type
> org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocume ntProvider$ProblemAnnotation,
> whereas reporting the same errors in the same way during Build produces
> text annotations of type org.eclipse.ui.texteditor.MarkerAnnotation. While
> the former are IJavaAnnotation and are processed correctly in
> collectProposals() at line 263 in JavaCorrectionProcessor, the latter are
> not, and seem to go unnoticed to my quick fix processor.
>
> Is there anything I'm doing wrong, or is there a bug here?


Hmm, sounds like probably a bug, although I'm not sure what the fix will be.
It's been quite some time since I worked on that part of the APT code that
generates those markers, but I remember there being some reason for that
distinction... ISTR it took a lot of tweaking to get it so that markers and
annotations showed up at the right time and got cleared at the right time.

Please enter a bug report in Bugzilla, specifying exactly what version of
Eclipse you're using, and include a sample annotation processor and
quick-fix processor that demonstrate the problem. Hopefully we can still
get a fix into Eclipse 3.5 - we're getting close to the end of the cycle
when it gets hard to make code changes.

Out of interest, why are you disabling "Allow annotation processing in
editor"? Not that I disagree, I'm just wondering.
Re: APT and QuickFixes [message #259620 is a reply to message #259491] Fri, 17 April 2009 13:42 Go to previous messageGo to next message
Eclipse UserFriend
> Hmm, sounds like probably a bug, although I'm not sure what the fix will be.
> It's been quite some time since I worked on that part of the APT code that
> generates those markers, but I remember there being some reason for that
> distinction... ISTR it took a lot of tweaking to get it so that markers and
> annotations showed up at the right time and got cleared at the right time.
>
> Please enter a bug report in Bugzilla, specifying exactly what version of
> Eclipse you're using, and include a sample annotation processor and
> quick-fix processor that demonstrate the problem.

OK, I'll get it ready next Monday.

> Hopefully we can still
> get a fix into Eclipse 3.5 - we're getting close to the end of the cycle
> when it gets hard to make code changes.
>
> Out of interest, why are you disabling "Allow annotation processing in
> editor"? Not that I disagree, I'm just wondering.

I'm disabling it because it is slowing down the whole user experience of
typing in code. My annotation processor is quick to execute, but (as
discussed before in another thread) building the
AnnotationProcessorEnvironment still requires a large amount of file
parsing prior to calling the annotation processor, which can easily last
a few seconds. I thought it was enough to have the errors reported at
build time only (although getting them at reconcile time would be even
better, agreed).

Cheers,
J.-P.
Re: APT and QuickFixes [message #259677 is a reply to message #259491] Wed, 22 April 2009 03:40 Go to previous message
Eclipse UserFriend
Walter Harley wrote:
> Please enter a bug report in Bugzilla, specifying exactly what version of
> Eclipse you're using, and include a sample annotation processor and
> quick-fix processor that demonstrate the problem.

I've filed a new bug and provided sample code here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=273088

Thanks!
J.-P.
Previous Topic:Annotation processing (JSR 269) - Error/warning messages on annotated parameter
Next Topic:HELP - JavaModelException
Goto Forum:
  


Current Time: Mon Sep 15 05:51:58 EDT 2025

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

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

Back to the top