[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.jdt] Re: [APT] Messages showing up in Error Log rather than Problems View

"Gunnar Morling" <morling.eclipsebugzilla@xxxxxxxxxxxxxx> wrote in message 
news:b28267f05f3610b97b98fc5c17b05019$1@xxxxxxxxxxxxxxxxxx
> Walter Harley wrote:
>
>> Specify the element that you're reporting the message against.  If you 
>> take a look at the API, you'll notice that there's a varargs parameter at 
>> the end of that printMessage() method - you need to give it an Element so 
>> it knows what to associate the message with.
>
> Walter,
>
> thanks for your hint. Basically it is working now (an error appears in the 
> problems view, and the concerned element is underlined red in the Java 
> editor), as I'm using the following overloaded version of the 
> printMessage() method:
>
> printMessage(Diagnostic.Kind kind, CharSequence msg, Element e, 
> AnnotationMirror a, AnnotationValue v)
>
> But as opposed to APTDemo.jar (containing a Java 5 processor, available 
> from Eclipse JDT-APT home) not the annotation's attribute value is 
> underlined in the editor, but rather the attribute name (for instance 
> "what" when referring to the DemoAnnotation from said JAR).
> Is this intended or is there any way to get the attribute value underlined 
> instead?


Can you post the code you are using, in particular the call to printMessage 
and the initialization of the arguments you are passing to it?