How many times did you write a TODO comment in your code? How many times did you forget about this comment and met it again only some months later? It happens a lot to most of the developers who eventually tends to write their TODO missions on some papers, notepad or a ToDoList application. From what I know, most software developers are not aware of the fact that they can view all of their TODO comments in one list. Just go to View->Task List and you will get a window which contain all of the TODO comments:
In fact, the presented comments are the comments which include the following phrases (by default): HACK, TODO and UNDONE. How do I know that? Just go to Tools->Options->Environment->Task List and see the Tokens list. You can also add more tokens of your own by clicking on one of the existing tokens, change its name, click on the Add button and click OK:
Now, my task list will look like that:
Notice that with Visual Basic projects, the Task List displays all of the comments in the project. With C# projects, the Task List displays only the comments that are found in the files currently opened for edit. With C++ projects, the Task List displays only the comments that are found in the file currently active in the editor. I can’t figure out why did they (Microsoft) implemented it like that, what was the problem to let the user choose which comments are presented: those in the current project, in the currently opened files or in the currently active file in the editor…
I am curious to hear if you guys knew about that issue.
We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn More
David Said on Sep 1, 2008 :
VS2008 SP1 supposedly fixes the list to display TODO from all files in the solution not just the open files, and certainly is working for the C++ project I’m working with today.
Adrian Aisemberg Said on Sep 1, 2008 :
The custom tokens are a good idea.
However, while keeping our code clean from compilation warnings, we can use this line as a TODO line:
#warning TODO: Fix this…
This line will cause a compilation warning, so you’ll keep noticing it until fixed.
In addition, if your project is being built with a continuous integration system that reports errors and warnings, everyone will notice it.
And here’s a tip:
Create a code snippet for the ‘todo’ keyword to parse that line, with the ‘Fix this…” text as a parameter.
PHenry Said on Sep 12, 2008 :
Thanks for this information, I took your code and personalized it for my own use. I also created a blog entry. Thanks again.
http://www.pchenry.com/Home/tabid/36/EntryID/28/Default.aspx
David Adams Said on Jul 14, 2009 :
Very nicely done! Works like a champ.
Alex Williamson Said on Nov 12, 2009 :
That’s a pretty good hint, one of those settings you never seem to get round to playing with - but I’ll be using this in the future.