TODO Comments in the Task List

Tips Search

TODO Comments in the Task List

  • Comments 21

Versions:  2008,2010
Published:  6/7/2010
Code:  vstipTool0029


Ever been writing some code and you want to leave a reminder to yourself to do something on a particular line or area?  Did you know about the "to do" comment feature?  It seriously rocks if you have never used it AND, because it goes in the source code, everyone can have access to the information when you do you check-in!


So here's how it works:  In VB you just put any comment in that begins with the letters "todo" (case doesn't matter):



In C#, it's pretty much the same thing (again, case doesn't matter):



C++ requires that the “TODO” be in upper-case or it will not show up in the Task List:




In C++ for VS2010 you have to explicitly turn this feature on.  Go to Tools | Options | Text Editor | C/C++ | Formatting | Miscellaneous and change Enumerate Comment Tasks to true:




Regardless which language you use the result is a nice entry in your Task List:



NOTE:  In order to see these items, you have to click the drop-down list in the Task List and choose Comments as shown here.

  • C++ programmer says thanks for the post. I

  • This works for me. Problem is that task list keywords are probably being searched only in opened files. But it works for me.

  • Thanks Tim N, the // HACK is a useful one to know!

  • If you use it in c++, you need a colon(:) and a space( ), eg:

    //TODO: just for test.

  • I am working in windows7 and vs2012 and Task List does not work

  • Comments appear for the entire solution (VS2010). I'd like to be able to show TODO comments per-project: otherwise, the noise to signal ratio (in solutions with tens of projects) makes the tool very uncomfortable to use. Maybe in a SP sometime?

Page 2 of 2 (21 items) 12
Leave a Comment
  • Please add 2 and 3 and type the answer here:
  • Post