Directory Freebies VS CheatSheet Forum

RSS

Email

Translate

Home About Archive Privacy Contact Advertise Write for Dev102
Posted by Shahar Y on Sep 1st, 2008 | Filed under .Net, Visual Studio |

todo-list 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:

image

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:

image

Now, my task list will look like that:

image

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.

Tags: , , , , , , , , ,

6 Responses to “Visual Studio - See Your TODO Comments In One List”


  1. 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.

  2. 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.

  3. 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

  4. David Adams Said on Jul 14, 2009 :

    Very nicely done! Works like a champ.

  5. 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.

1 Trackback(s)

  1. Sep 1, 2008: Dew Drop - September 1, 2008 | Alvin Ashcraft's Morning Dew

Post a Comment

Write Article for Dev102

Write for Dev102!

We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution

Learn More