Re: [Pydev-code] How to know when code-folding is applied the first time an editor is opened?
Brought to you by:
fabioz
From: Fabio Z. <fa...@gm...> - 2015-04-13 22:57:19
|
Hi Andreas, I think that if you just mark collapsed on the first time that the CodeFoldingSetter sets the annotations that should work... on new runs it should only recreate the annotations that were actually added. I.e.: in org.python.pydev.editor.codefolding.CodeFoldingSetter.getAnnotationsToAdd(List<FoldingEntry>, ProjectionAnnotationModel, List<PyProjectionAnnotation>) the 'existing' parameter has the annotations that exist and should be removed (so the annotations that should not be changed should be removed from that list). Cheers, Fabio On Fri, Apr 10, 2015 at 6:43 AM, Andreas Pakulat <an...@fr...> wrote: > Hi, > > I've tried to add a new option for code-folding that allows PyDev to > automatically fold comments when initially opening the editor. We'd like to > have that in our IDE for the Python scripts. > > Unfortunately just passing isCollapsed=true to ProjectAnnotation when a > corresponding preference is enabled means that the comments are also > collapsed whenever the user saves the file. Thats undesirable and I'm > currently wondering what the best way would be to tell the > CodeFoldingSetter > class wether it should apply the initially-collapsed setting or not when > setting up the annotations? > > I guess one option would be to avoid re-creating the annotations, so that > the > editor framework would take care of that, but I'm not sure how to go about > that either - could I compare the ASTEntry's that the annotations keep? > Would > they be equal or have some comparable properties between runs? > > Andreas > > -- > Andreas Pakulat sq...@fr... > froglogic GmbH - Automated UI and Web Testing > > > ------------------------------------------------------------------------------ > BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT > Develop your own process in accordance with the BPMN 2 standard > Learn Process modeling best practices with Bonita BPM through live > exercises > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- > event?utm_ > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |