python-3.xpydevaptana3

Is there a way to override Aptana Studio 3 PyDev collapse code?


I'm coding Python Python 3.6.4 using Aptana Studio 3 build 3.6.1 with PyDev. I use the collapse/uncollapse code feature constantly as I work. I have my code structured in sections with comment headers, like this:

# ********** DEFINE CONSTANTS **********
DEBUGGING = FALSE
VERSION = "1.4.6"
...

# ********** DEFINE FUNCTIONS **********
def get_member_level(membernum) ...
def get_item_discount(itemnum) ...
...
def last_function() ...

# ********** DEFINE CLASSES **********
class ButtonListPanel(): ...
class DetailPanel(): ...

The problem is, when last_function() is collapsed (by collapse all code, for example), it takes the comment header with it.

I know it seems like a minor thing, but those section header comments really help me to navigate through a source file quickly, and I have quite a few of them. Is there any way to make that comment not collapse?


Solution

  • By default there's no way to configure that...

    What you can do is change PyDev itself to do what you want (i.e.: this is handled in org.python.pydev.editor.codefolding.CodeFoldingSetter -- http://www.pydev.org/developers.html has details on how to get the source code).

    You can also create a feature request for that, but given the existing requests already there and my limited time, I'm not sure when this one would get to the top of the queue.