You should try to create the markers with the Pydev marker utils:
from org.python.pydev.builder import PydevMarkerUtils
with the method:
createMarker(IResource resource, IDocument doc, String message, int lineNumber, String markerType, int severity, boolean userEditable, boolean istransient, List<IMarker> existingMarkers)
You can see an example that uses it at http://pydev.cvs.sourceforge.net/pydev/org.python.pydev/src/org/python/pydev/builder/todo/PyTodoVisitor.java?view=markup
If that does fail, you can try doing a refreshLocal (but I don't really think it should be needed):
from org.eclipse.core.resources import IResource
from org.eclipse.core.runtime import NullProgressMonitor
I am trying to write an extension to bookmark all occurrences of a
selection but I am having trouble getting the bookmark icons to show up
unless the file is closed and re-opened again.
I have the following code:
selection = PySelection(editor)
line = selection.getCursorLine()
resource = editor.getIFile()
if not resource:
log("Did not get a file resource")
return # Give up.
marker = resource.createMarker(IMarker.BOOKMARK)
if not marker:
log("Did not get a marker")
return # Give up
marker.setAttribute(IMarker.MESSAGE, "This is my marker")
When this code is executed in a Pydev extension the bookmark shows up
immediately in the bookmark view, but the little symbol does not show up
until the file is closed and re-opened.
As far as I can tell the file is synchonized, and I have tried touching
the file to make sure that it is up to date.
log("Resource is synchonized")
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
pydev-code mailing list