From: Fabio Z. <fa...@gm...> - 2006-05-23 14:33:22
|
Hi Don, On 5/23/06, Don Taylor <nos...@gm...> wrote: > > Fabio: > > I wonder what you think of the idea of being able to "Bookmark all > Occurrences" as well as "Mark all Occurrences"? > > The idea is that you want to keep markers to all occurrences of a > selection while you go through the code making modifications to the > code. "Mark all Occurrences" is 'read-only' in that as soon as you > click elsewhere in the code then it changes the thing being marked. > This is useful, but sometimes you want to keep the 'markers' around > while you are editting. > > My suggestion is to create a bookmark on every line that contains an > occurrence. The bookmark names would all be the same - the text of the > occurrence. The normal bookmarks view can be used to navigate and > delete the bookmarks. > > I thought that I could do this in a Pydev script - but your occurrence > finding code is in Pydev extensions so I don't think that I can get at > the marking code, can I? You don't actually need the code, just get the occurrences directly... You can use them through the java API getting the occurrences directly, or get them from the cache I store them (at the editor).... So to get the annotations: from com.python.pydev import PydevPlugin editor.cache.get(PydevPlugin.ANNOTATIONS_CACHE_KEY) --> will return you a List<Annotation> To get the Position of the Annotation, you can do: annotationModel =3D editor.getDocumentProvider().getAnnotationModel( editor.getEditorInput()) annotationModel.getPosition(annotation) Cheers, Fabio |