Search code examples
eclipse-pluginmarkerseclipse-pde

Eclipse plugin: Persistent markers not persisting


I've developed a quick and simple plugin that adds line markers for lines containing the text "TODO", based on the "Plugin with an incremental project builder" template.

It works, but markers are not persisted between Eclipse sessions (restarts).

I have the following element in my plugin.xml:

<extension
     id="todoTask"
     name="TODO Task"
     point="org.eclipse.core.resources.markers">
  <super type="org.eclipse.core.resources.taskmarker">
  </super>
  <persistent value="true"/>
</extension>

Again, the plugin works fine, so this is processed, but it doesn't seem to matter if I set the persistent value attribute to true or false, it just doesn't persist the markers.

Why aren't the markers persisted and how can I fix this? Do I need to perform additional programming/configuration to persist them? Thanks.


Solution

  • I found out what the problem was through trial and error. The marker id needs to have a dot in it in order to actual be counted as a marker type. So in your case try setting id="todoTask.marker" for example and then calling someResource.createMarker("todoTask.marker"). Oh, and maybe write the id with lower case letters, just to be on the safe side