[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-ui-dev] Syntax coloring for "Logger-Code"


I’d like to extend the java editor syntax coloring to know about “Logger-Code”. Its purpose is to better differentiate between “production” code and “logger” code, which are mixed in the same file/method (we are aware that this problem may be better solved i.e. using aspects, but we simply cannot do this now). The more important production code is hard  to read when mixed up with logger code, so we want to give it another color, like “light-gray” so when the developer is reading the file he better can “ignore” the logger code and focus on production code.

Logger-Code is simply an “if”-Block: It starts with “if(logger.” and ends with “} //” or it may be a single line like “logger.entering();” - starts with “logger.” and ends with “;”

A screenshot how this should look like is attached to this mail.


I’ve spent quite some time looking at FastJavaPartitioner, JavaCodeScanner, IJavaColorConstants (and lots more), followed those references and tried/error by copy/paste relevant parts but the result did not work really well. Could you please give me hints from where to start to add such a feature? May I can follow an existing feature and see how its implemented and do it the same way?


Kind regards





Attachment: LoggingCodeColoring.png
Description: LoggingCodeColoring.png