Comment colour in pydev

  • JohnXB

    JohnXB - 2006-07-19

    Newbie question - How can I change the colour used to display comments in python scripts in eclipse(3.1.2 python 2.4)?



    • Fabio Zadrozny

      Fabio Zadrozny - 2006-07-19

      In the preferences:

      window > preferences > pydev

      On earlier versions of pydev, that preferences page was kind of big, so, you might have to stretch it depending on the resolution you're using (on the latest versions this was changed).



      • anthony shah

        anthony shah - 2008-05-27

        Why don't multi-line comments conform to the same syntax highlighting preferences as the single-line comments, instead of the string coloring.

        My comments preference is grey, and string is green.  So shouldn't multi-line comments (""" .... """) be grey also, not green like strings ?

        Is this an overlooked bug or do people want their multi-line comments to look like strings, not comments ?

        • Fabio Zadrozny

          Fabio Zadrozny - 2008-05-27

          If you use ''' ''' in python, that's a string in the same way that ' ' (so, you can assign it to a var, etc). In functions / classes, the first string is considered a docstring and is assigned to the function / class (but it could be a string with ' ' also, and doesn't necessarily  need a ''' ''').

          So, ''' ''' is actually a string and # is the only comment that python has (there are no multi-line comments in python).



    • drmaples

      drmaples - 2006-07-19

      Window > Preferences.
      click on Pydev
      in the "Appearance color options:" change comments to whatever color you want.

    • JohnXB

      JohnXB - 2006-07-19

      Thanks, Fabio, Darrell!
      I had looked there already but I was expanding the '+' so never saw the top level. Doh...

  • martin

    martin - 2011-02-23

    Hi Fabio,

    can we have different colors for # comments and ## comments?
    So we could have real comments in maybe green an "outcommented" lines in maybe light grey.

    That would be great!

    Thank you for your work,

  • Fabio Zadrozny

    Fabio Zadrozny - 2011-02-23

    Please enter a feature request for that.