Bug 299016 - Extend the org.eclipse.jdt.apt.core.util.EclipseMessager interface "print" methods with information
Summary: Extend the org.eclipse.jdt.apt.core.util.EclipseMessager interface "print" me...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: APT (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Generic inbox for the JDT-APT component CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-07 04:00 EST by Danail Branekov CLA
Modified: 2010-04-22 01:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danail Branekov CLA 2010-01-07 04:00:16 EST
Hello,

Upon calling EclipseMessager.printError()/printWarning()/printNotice method a marker is created for the relevant eclipse resource. The marker has an ID (org.eclipse.jdt.apt.core.internal.AptPlugin.APT_COMPILATION_PROBLEM_MARKER or org.eclipse.jdt.apt.core.internal.AptPlugin.APT_NONRECONCILE_COMPILATION_PROBLEM_MARKER) and a message (displayed in the problems view). What the marker misses is machine-friendly information (such as e.g. error code) which "client" plugins could use to identify whether they are interested in the error.
Therefore it probably makes sense to extend the print* methods with arguments for custom error/warning/notice properties. These properties could be represented by a Map<Object, Object> so that annotation processors could supply whatever data they need.

Regards, Danail
Comment 1 Walter Harley CLA 2010-04-22 01:53:46 EDT
Hi, Danail.  Sorry for the delayed response.

It seems like what you are asking for is pretty close to what the PrintFixableXxx() methods do; they accept an errorId which is intended to be machine-readable.  Do these methods meet your needs?  If not, can you explain your use case in more detail?  You mention "client plugins [that] are interested in the error" but I am not sure exactly what you mean.