Special color for TODO comments

Post a reply

:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review

Expand view Topic review: Special color for TODO comments

Re: Special color for TODO comments

Post by robert » Sat Sep 21, 2013 5:00 pm

Actually, the "show TODO items in a table" thing is already doable (as long as you write the table component :D). This is done in RText, for example. This won't color them uniquely in the editor of course, as this would have to be built into the lexer.

RSTA comes with a TaskTagParser class, which can be installed like any other RSTA Parser, and locates TODO items. Unlike most Parsers, it doesn't squiggle underline the stuff it finds, but it does return them. The idea is that they can then be displayed in an ErrorStrip (which is done automagically), and if you want to display them elsewhere in the UI, like FlashDevelop does, you can do this yourself (which is what RText does).

java code:

TaskTagParser parser = new TaskTagParser();
parser.setTaskPattern("TODO|FIXME|HACK|REMIND|XXX"); // A regex of "todo" identifiers in comments

Re: Special color for TODO comments

Post by mgarin » Fri Sep 20, 2013 6:04 pm

I did not work with FlashDevelop, but yes, i know that there are a lot of editors which have different behavior and code highlighting.
Also i know that 3 most popular IDE for Java - IntelliJ Idea, Eclipse and NetBeans - do have TODOs highlight.
Actually a lot of code editors (and even some text editors) highlight some key phrases like "TODO", "FIXME" and others - TODO is simply the most popular one.

Also IDEs i mentioned before have a similar frame to the one you shown on the screenshot - with TODOs in your class/project, but that is totally different feature.
It is much better to see the TODOs highlights right in the code so you can easily spot them near some method/variable or whatever else while scrolling/reading through.
The frame with class/project TODOs might be used for other purposes but it is not a replacement for highlight at all.

Also, if such feature will actually be added into RSyntaxTextArea - you can just switch it off or simply set the color to the same color comments use, if you don't like that highlight so much of course.
So i don't really see why separate frame "is a much better solution" and why TODOs should not be added as a highlight option :)

Re: Special color for TODO comments

Post by as3boyan » Fri Sep 20, 2013 5:31 pm

Have you saw this:

FlashDevelop shows lines that has //TODO or //FIXME or //BUG under Tasks tab
But it doesn't set special color for those comments, I think that is much better solution, and don't require RSyntaxTextArea code changes.

Re: Special color for TODO comments

Post by mgarin » Wed Sep 18, 2013 1:00 pm

Re: Special color for TODO comments

Post by robert » Wed Sep 18, 2013 12:05 pm

Please add a feature request on GitHub so this request can be tracked.

Special color for TODO comments

Post by mgarin » Wed Aug 21, 2013 11:49 am

TODOs highlighting might be a good addition.
Ofcourse if it is possible to add without some hard manipulations or code syntax parsing...

Here is an example of TODOs in Java code (in RSyntaxTextArea):

And here is how IntelliJ IDEA highlights it:

Basically - it highlights anything that goes after "todo" mark (ignoring case) inside any comment with blue color.
Color can be moved to RSyntaxTextArea style settings i guess.