Customizing TODO filters

Note   Contributed by: Esko Luontola

Probably, you already know about IntelliJ IDEA TODO window that finds your “TODO” comments and helps you quickly navigate to them. But did you know that you can work not only with TODO comments, but with any custom pattern?

For example, when you create a quick fix for a problem and don’t have the time to create a proper solution, you write a “hack” and leave a comment. You can start the comment from “Hack” and then explain why this code is bad and what should be done to fix it. Of course, it would be useful to find these comments later and navigate to them like you can do with TODO.

To add a new comments pattern, you need to press “Filter TODO Items” icon in the TODO tool window, and then select Edit Filters.



This will open the TODO dialog, where you can add, delete and modify your patterns. You can also apply filters that will display only certain patterns in the TODO window (to switch between filters, use the same “Filter TODO Items” icon).



When you add a new pattern, you can also specify the text color (it will appear in both the editor and TODO tool window) and the icon that can be used to show the priority.



After that, you can find your “hack” comments in the TODO window.



Technorati tags: , ,
This entry was posted in Tips & Tricks. Bookmark the permalink.

11 Responses to Customizing TODO filters

  1. Brian Schaad says:

    Is there a way to share todo tags with the team?

  2. Gabriel Falkenberg says:

    Is there a way to have multi-line todo-items?

  3. Uzbekjon says:

    I would also love to know if there is a way to have multi-line TODO’s !

    I have very long todo’s with explanation of what should be done, but IDEA is turning only the first line into blue …

    Woudl really apreciate any directions …

  4. Larry says:

    Will removing todo comments eventually make the files go off the list? :-/

    Grr…

  5. flex-developer says:

    I have flex and php code in my project. TODO works only for .php files(not for .mxml files).

  6. Anton says:

    what about multiline TODO?

  7. Victor says:

    Will very appreciate if somebody answers question about multi-line TODOs.

  8. yole says:

    Right now there is no support for multiline TODOs. See http://youtrack.jetbrains.net/issue/IDEA-62161 for more information.

  9. abercrombie says:

    Is the TODO works only for php file?

  10. hubert says:

    is there a way to automatically generate and assign a unique number to a todo ?

  11. Chris says:

    I’d like the TODO window to show only TODOs that I’ve added (maybe based on VCS/local history diffing). As is, I can switch to ‘Default Changelist’ in the TODO window but that shows *all* TODOs in files I’ve edited not just ‘my’ TODOs.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>