Menu

#771 Class code folding incorrectly folding module level comment

open
Editor (491)
5
2008-08-18
2008-08-18
No

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

Discussion

  • Andrew Carter

    Andrew Carter - 2008-08-18

    .py file of code shown in example.

     
  • Zytrex

    Zytrex - 2010-05-15

    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.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.