| Detecting Changes about Compilation Errors (and related IMarkers) [message #781391]
||Sat, 21 January 2012 05:13
| Kivanc Muslu
Registered: November 2010
Hi all, |
Let's say that I have a project with one compilation error. In my plug-in, I retrieve its marker with the following code:
private static IMarker  findJavaProblemMarkers(IProject project)
IMarker  markers = null;
markers = project.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
again assume that I get an IMarker with id (i.e., IMarker.getID()) 513253. Now, assume that I have added one blank line to my file that had the compilation error. Though, it didn't change the compilation error (it is still the same problem), now I get an IMarker (with the same code) with id: 513280.
That is why I cannot use IMarker.getID() to detect changes on IMarkers (or compilation errors). I wonder if there is another way to do this?
What I need is the following:
- As long as the changes to the document does not affect that compilation error, I want to detect it (somehow, by comparing some internal thing in the IMarker of something else) as the same compilation error.
- If there is a new compilation error added, I would be getting a new IMarker for that, so I can detect it.
- Similarly, if a compilation error is resolved, I would get one less IMarker, so that is also fine.
- However, for example, if that compilation error changes (i.e., I have modified the compilation error, however there is still a compilation error), I want to detect it as a new compilation error.
Is this possible and what can I use internally to detect these changes?
[Updated on: Sat, 21 January 2012 05:19]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01735 seconds