Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IDE comment keywords

So I only recently discovered the TODO comment. For those of you that don't know, most modern IDE's will recognize this word in a comment and flag the comment line a different colour so It stands out.

EG.

//Need to talk to Bill about refactoring this code  //TODO:Need to talk to Bill about refactoring this code 

You may notice in IDE's like Eclipse or Rubymine highlight the TODO comment and some nice other features to do with it.

My question is: What other keywords are there like the TODO? It seems like a much better way of communicating to developers through comments and a feature that should be a bit more widely known in IDE's. Their purpose is to help with development after all..

like image 399
OVERTONE Avatar asked Mar 06 '12 15:03

OVERTONE


People also ask

What are todo comments?

In general, a TODO is written to tell future maintainers about something important: something that should be added, or should be changed, or should not be forgotten. The intention is often to increase the quality of the code. Sometimes a TODO comment can save you a lot of time!

How do you add a comment in Java?

Single-line comments start with two forward slashes ( // ). Any text between // and the end of the line is ignored by Java (will not be executed).

How do I add a comment todo?

To create a TODO commentPlace the caret where you want to create a TODO item and add a comment, for example, by pressing Ctrl+/ , then type TODO or FIXME , and then type your note. View the list of TODO items in the TODO tool window.

How do I create a TODO comment in Intellij?

In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Editor | TODO. Use a regular expression to specify a custom pattern. This matches the word "optimize" ( \b designates word boundaries) and allows any number of other characters in the comment. Then click OK to save the new pattern.


2 Answers

I can speak of Eclipse, you can customize it.

Click on Window -> Preferences, and search for General -> Editors -> Structured Text Editors -> Task tags, or for Java -> Compiler -> Task tags (there might be some additional ones like for JavaScript, PHP, StatET, etc.)

TODO, FIXME, XXX 

I use some additional ones like:

CHECKME, DOCME, TESTME, PENDING 

I personally like to use the DISCUSS/REVIEW tags just to make sure I speak about some issue with someone during a code review or pair programming (e.g., I haven't misunderstood the specification how something should work etc.).

You can also set the priorities assigned to the different task tags there too.

like image 96
rlegendi Avatar answered Sep 20 '22 13:09

rlegendi


These are known as task tags. In Eclipse they are TODO, FIXME, and XXX.

However, Eclipse allows you to modify the available list of task tags. Go to preferences > Java > Compiler > Task Tags

Here you can modify the available list of task tags, change their priority, and decide if task tags should be case sensitive or not.

like image 35
helloworld922 Avatar answered Sep 23 '22 13:09

helloworld922