TODO Comments in the Task List

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.

Comments (22)
  1. I've failed to make it work in pure C++ – does it requires managed language?

  2. zainnab says:


    I does look like it only works in C# and VB.  I've pinged the C++ team to see when/if this feature is planned anytime soon.


  3. Sumit Kumar says:

    In C++, the ‘comments tasks’ in the Task List window is turned off by default due to performance reasons. You can turn this feature on from Tools->Options->Text Editor->C/C++->Formatting-> Miscellaneous->Enumerate Comment Tasks.

    We apologize for the inconvenience.

    Sumit Kumar

    Visual C++ Team

  4. zainnab says:

    Thanks Sumit! 🙂

    I've updated the post to reflect this info.


  5. Wizoo says:

    Alright, thx for the tip with c++ 😉

  6. DE Web Works says:

    When I open my VS2010, the comments aren't there. Once I open a page that has TODO comments, then they show up in the list. Is that normal?

  7. zainnab says:

    When you open the solution it should populate with all the todo comments so it looks like you may have an issue with the loading of the comments.

  8. Brett says:

    I've gotten it to work in C++ Add a colon (:) to the end of TODO like so:

    TODO: Work needs done here

  9. zainnab says:

    Brett — By default it should not require any colons at the end unless the token has been modified.  


  10. Gary C says:

    It would be nice to be able to export all TODO type items (the user can define other tags to flag in the comments section such as TESTCODE). If I could export them, I would put them in our issue tracker system to help identify all of the work that needs to be addressed in the project.

  11. zainnab says:

    Gary — Yep I agree.  I'm going to ping the VS Team and find out if that is in the plan for a future version.


  12. Rick says:

    In VS2008, does this work for C++? Miscellaneous is not in the formatting options.  

  13. zainnab says:

    Rick — Looks like that one got by me.  I'll update the post.  🙂


  14. Tim N says:

    maybe also worth mentioning is //hack instead of //todo for temporarily made (custom) changes

  15. geoyar says:

    Ok, why it is not in help? Help tells about Tools/Options/Environment/Task List only.

  16. Gene says:

    C++ programmer says thanks for the post. I

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

  18. Mike says:

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

  19. qiancheng says:

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

    //TODO: just for test.

  20. SudanBoy says:

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

  21. Pablo says:

    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?

  22. Catto says:

    Hey Now Zain;

    Still enjoying your info about VS; this TODO is classic and a good reference.



Comments are closed.

Skip to main content