Syntax highlighting
Apr. 25th, 2007 12:50 pmHow much syntax highlighting do you generally get when you edit code? Any?
Does it call out different variable types?
Can you easily configure it dynamically to eg. highlight different ifdef branches or variables with certain prefixes?
Should it be able to?
Does it call out different variable types?
Can you easily configure it dynamically to eg. highlight different ifdef branches or variables with certain prefixes?
Should it be able to?
no subject
Date: 2007-04-25 01:17 pm (UTC)I could, I suppose, configure it to highlight variables with a particular prefix, since that can be done at the purely lexical level. However, you specified "easily", and it certainly wouldn't qualify as that: I'd have to reimplement chunks of the standard C mode in my
.jedrcand have them override the normal version. Also, I'd run out of colours.As for "should" ... I'm not sure. It's possible that I might find uses for such functionality if it could be easily done; but I've never felt its lack. More generally, one might present various arguments against making syntax highlighting too complicated:
- it would slow the editor down
- it would encourage people spending more time configuring their highlighting scheme and less time coding
- the closer the editor comes to fully understanding the source language, the more people will tend to work on the assumption that it will always agree with the compiler, leading to significantly greater inconvenience on the few occasions when it doesn't
- writing editor modes for new languages becomes a lot more effort.
On the whole I think I'm happy with the level of highlighting I have now: simple to implement for a new language, quick to perform during editing, and relatively robust in the face of things the editor doesn't understand.