Class code folding incorrectly folding module level comment
Brought to you by:
fabioz
Just updated PyDev today and found a new bug (I think).
If you have a file that looks like this:
---- START OF CODE
class Person(object):
pass
# COMMENT #1: THIS IS A MODULE LEVEL COMMENT.
class Artist(Person):
pass
""" COMMENT #2: THIS IS ALSO A MODULE LEVEL COMMENT. """
-- END OF CODE
The PyDev code folding will fold comment #1 into the Person class. This is not correct since this is a module level comment (to be in the class, it should be indented).
Commnet #2 -- which uses """ instead of # -- works correctly.
SYSTEM:
PyDev for Eclipse on Windows XP.
PyDev version 1.3.19.
Eclipse version 3.4.0
.py file of code shown in example.
I can confirm that this problem still exists in Python 2.6.4 and Pydev 1.5.7. Also, I've noticed that if the last line of a class or function definition is further indented because it's inside a loop or if statement, then this problem doesn't occur.