I got a lot of ideas from the previous question ( How to display an error sign in a Package when the package has incorrect information? )
But the problem marker is not displayed.
The resource that interests me is the XML file.
So, I added a listener for PRE_BUILD using the following code:
addResourceChangedListener(xxx, IResourceChangeEvent.PRE_BUILD)
It works great. Now I'm trying to add a problem marker.
IMarker marker = file.createMarker(PROBLEM_ID);
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
marker.setAttribute(IMarker.MESSAGE, "Error Message");
marker.setAttribute(IMarker.CHAR_START, 5);
marker.setAttribute(IMarker.CHAR_END, 6);
marker.setAttribute(IMarker.LINE_NUMBER, 5);
Runs on code. But the problem marker does not appear in the Editor and Problem views. How can I show the problem marker correctly?
source
share