35

In a Eclipse a // TODO comment in a Java file marks an area in code as a task for later consideration.

Is there a way to add other expressions that will do the same?

For example if I want to use // myprojectname.

Lii
  • 11,553
  • 8
  • 64
  • 88
richs
  • 4,699
  • 10
  • 43
  • 56

3 Answers3

68

Window > Preferences > Java > Compiler > Task Tags

You can add new tags to your heart's content.


NOTE: Why the Eclipse guys made this a Compiler setting is beyond me. It just makes the setting hard for people to find, so it rarely gets customized.

Lii
  • 11,553
  • 8
  • 64
  • 88
benjismith
  • 16,559
  • 9
  • 57
  • 80
  • 2
    They put it under Compiler because the code needs to built before the tasks will show up. Yes, sometimes they do show up when you save, but some can be missed. – Ascalonian Aug 03 '09 at 20:39
  • 9
    +1 for your note. I can almost never find anything in Eclipse, assuming that I even know it exists and what it's called. It's still my IDE of choice or whatever, but it has some serious interface problems. – andronikus Apr 30 '12 at 15:27
14

The answers by benjismith and j pimmel are perfectly valid and correct. I just want to add that you can find this and other settings by using eclipse's neat preference-dialog feature:

When you open the preferences dialog via "Window/Preferences", type "todo" in the text field in the upper left corner. The options tree will be limited to matching settings.

Voilá

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
1

I did it like this on my Mac Machine,

Eclipse>Preferences>Java>Compiler>Task Tags >New

Now eneter the TAG and set it's Priority (viz. Normal, Low or High).

Apply>OK

A dialog will popup and will ask you for a complete rebuild, tell it to rebuild now. You are good to go after a rebuild.

Atul Kaushik
  • 5,181
  • 3
  • 29
  • 36