Visual Studio, the IDE of choice for Windows C++ development here at Simba, has a useful ‘Task List’ feature that lists locations in the code marked with a “TODO”. You can get TODO or other tokens in your comments to show up in the Task List with a few easy steps. I’ve seen conflicting instructions elsewhere on the web, so here is what I’ve found to actually work for VS 2008, 2010 and 2012:
- Open the task list: Select View -> Other Windows -> Task List
- Enable the comments (for VS 2010 & 2012): Tools -> Options -> Text Editor -> C/C++ -> Formatting -> Miscellaneous, and set Enumerate Comment Tasks to True.
- Set the task list pane to show tasks from the code: select Comments
- Write TODO tasks in the form of “// TODO: task” (the colon after the token is important for VS 2012)
And then you should be able to see your TODO comments in the Task List pane!
Don’t like the default tokens? You can also add your own. The task tokens are defined in Tools -> Options -> Environment -> Task List. To add more, you first have to type in a name and then hit Add. (I can’t say that part is very user friendly, but at least it works.)
One last thing you should be aware of: Task Lists are apparently not enabled by default in C/C++ for performance reasons, so I suspect that it won’t work well with a large number of TODO tasks in any given file. Performance is probably also why only the tasks for the current file in show up in the Task List for Visual Studio 2012.