Tasks Embedded in the Source

When you create a new task, it is stored in your private tasklist file. If the task you are recording is related to code, this has the disadvantage that others who look at your code will not see these tasks.

Therefore, a better approach is to embed the task directly in the source code. When you have done that, the "Editor Task List" view will automatically show these tasks when you open a file containing embededd tasks.

There are some conventions for this which you should follow. For java code, consider using the "@todo" tag in your javadoc comment blocks. The javadoc proposed tags list, which you can read at http://java.sun.com/j2se/javadoc/proposed-tags.html, lists @todo as a reserved tag for this purpose.

An older convention, and one used for other languages than Java, is using "TODO", "XXX" or "FIXME" (in all caps) embedded in your code comments.

Sun's Code Conventions for the Java(TM) Programming Language, section 10.5.4 (found at http://java.sun.com/docs/codeconv/html/CodeConventions.doc9.html ) states the following:

Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken.
The vim editor automatically highlights these tags, and many other IDEs and editors do as well.

The Editor Task List will recognize lines containing the above tokens, and add tasks automatically to the editor task list. The set of recognized tokens can be customized by the user. Go to the Options dialog, and under Editing locate the Editor Task List sheet. It allows you to customize the regular expression which is used to match tokens in the source code.

Currently all occurrences of the tokens create tasks. There is an effort underway to enhance the source scanner such that only tokens that occur inside a code comment will be considered a task.


Comments & requests to dev@tasklist.netbeans.org. Further information at tasklist.netbeans.org.