Monday, January 21, 2008

Visual Studio Task List feature - I regret for not knowing this earlier

Do you use Visual studio's Task List? Atleast I was't using it so far and I regret for not knowing this earlier.

How it works

It works like this, you might want to do something at code at later point in time, just add a comment in this syntax

//TODO: Add exception handling here

or you are doing code review and felt a message should have been logged here just add a comment like this

//LOG: recursive function, log depth of stack

or you might have felt a method has grown too big, it must be refactored, just add a comment where ever you felt like

//REFACTOR: break this part as a function

How to access

And visual studio has a window to search for all these comments and present them in a list.

To show task list select from View -> Task List

By default it shows user task, select for comments from combobox.

How to customize

You can set more tokens from Tools -> Options Check in image here. TODO, HACK, UNDONE and UnresolvedMergeConflict are default tokens in visual studio. I added LOG and REFACTOR.

Check how a

TODO: Clean up and Log Something in code is shown with. And it is a clickable target

Also you can sort all log messages or TODO's to attend once.

Also you can define user defined tasks too.

For that select User tasks option in Task List and add your taks.

I felt the option very handy and felt like sharing it.

No comments: