Thursday, February 2, 2012

Better Syntax Coloring for IDEs

Modern IDEs like Eclipse already provide excellent syntax highlighting. Still I think there is room for improvement.

One idea of my ideas would be to color brackets differently. Instead of drawing them all in the same color, rotating through a color wheel would make it much easier to check, where which bracket is closed.

So this example code:

Would look like this:

Of course it's a detail, but a visual cue like this can help when you would try to extract the inner expression in FTFilter.notAnalyzed - Just start your selection from the green bracket, to the closing green bracket and you're done.

I already downloaded the JDT sources of Eclipse, but in order to have a fast and precise syntax coloring, the code is quite complex and I don't have the time to work into this. Still I believe a JDT developer could implement this feature very quickly - if you happen to know one, you might want to forward the URL ;-)

If you think this is a good idea, vote me up on DZone, or retweet this or +1 it on google... If there is enough positive feedback I'll go and file a bug for Eclipse, maybe it'll be in one of the next versions...

Update 1: I received a lot of positive feedback, thanks everybody. Three other programs seem to already support this feature: Microsoft Excel, Pharo Smalltalk (I think, only when the cursor is near a brace) and the Closure Plugin for Eclipse.

Additionally I hacked this functionality into a subclass of QSyntaxHighlighter for one of my Qt toy projects. As I've written here, this is quite simple.

Update 2: Just filed a Bug for Eclipse JDT-Text: