Ability to define color of the word "self"

9 months ago by

PyCharm lets you define the color of the word "self" just because it's used all over the place and is sort-of ignored when reading. I think it's a nice feature.

Community: Wing Python IDE

We might add support for this in the future.  Wing uses the scintilla's python lexer for syntax highlighting, which would support coloring self as a keyword.  Other options would be more difficult to implement.

written 9 months ago by Wingware Support  

That'd be a fine start for my purposes. I found it pretty nice that "self" was colored in PyCharm.

written 9 months ago by Ivan DelSol  

Would you want it colored as a keyword?

written 9 months ago by Wingware Support  

I think it would be a separate color category of it's own ('self' parameter) or something, since it is expected but is not technically any different from other parameters. You could just color the word itself or if you do some code analysis, you could color whatever word is in that parameter position for that function.

Another nice color category would be predefined Python functions like "__init__" and "__str__"

written 9 months ago by Ivan DelSol  

On second thought, it is different from other parameters, as it is provided automatically. So, the code analysis method probably makes way more sense than just coloring the string "self"

written 9 months ago by Ivan DelSol  
Isn't it possible to add custom coloring for any words\signs specified by user? For example I'd like to differentiate colors for brackets (round, square, curled)?
written 3 months ago by Mikhail Ninin Velikoselskiy  
You can change the things we color with the Edit > Syntax Coloring preference, or by writing your own .stx file.  Details on both are in http://wingware.com/doc/custom/syntax but this is limited to the things that the lexers identify.  'self' is not currently identified specially by the lexer in Wing so can't be colored now other than with the default text color.
written 3 months ago by Wingware Support  

Similar posts:
Search »