The Developer Stash

Arbitrary Contemplations
posts - 19, comments - 27, trackbacks - 0

My Links

News




Locations of visitors to this page

 





Elroy D'silva's Blog

Twitter












Archives

Post Categories

Blogs I read

TaskList in Visual Studio - Making it better

It was great to come across a new feature in Visual Studio - The TaskList. Well, yes it isn't new but, it certainly was new to me. I had never really come across this wonderful feature until last week when secretGeek blogged that code would suck less if the compiler could raise an error when a // TODO token was detected. A comment from Goran indicated that it was completely possible with the current versions of Visual Studio.

A //TODO: token.

Are shown in VS if you click TaskList. Couldn’t live without this one :)

Yeah, sure. Can’t live without it. Although the compiler doesn’t throw you an error, it indicates all parts of code where such tokens appear and hence can be taken care of easily.

 

How To Use

You can use the TaskList comments for:

  • Features to be added
  • Problems to be corrected
  • Classes to implement
  • Place-markers for error handling code
  • Reminders to check in the file

Add your comment in the code preceded by the token.        

tasklist_1

Once done, open up the TaskList from the View menu.

tasklist_2

Once the TaskList is up you will see something like this.

tasklist_3

The TaskList also allows custom tokens to be included. Go to Tools –> Options –> Environment –> TaskList.

 tasklist_4

User Tasks

You can add your own tasks in the TaskList by selecting the ‘User Tasks’ selection from the dropdown list on the TaskList toolbox. These tasks aren’t associated with code, but will allow users to add their own high level tasks.

 

Extending the TaskList

I would like to see the following additional options in the TaskList:

  • Task Alarms – which would associate an alarm with a high priority comment to help just in case you forget to take care.
  • User Tasks to be more specific (by having a file anchor like ‘Comments’) to allow user tasks to be associated with a particular line in code.

And no, I’m not waiting on Microsoft to extend it in some other version of Visual Studio. I’m starting right away to write a package that would do this for me, hopefully.

 

More Things to Remember

With Visual Basic projects, the Task List displays all of the comments in the project. With Visual C# and Visual J# projects, the Task List displays only the comments that are found in the files currently opened for edit. With Visual C++ projects, the Task List displays only the comments that are found in the file currently active in the editor.

Print | posted on Saturday, April 18, 2009 4:59 AM | Filed Under [ Visual Studio ]

Feedback

Gravatar

# re: TaskList in Visual Studio - Making it better

If you like how that works, you'd LOVE Behavior-Driven Development (BDD). I write out all my Todos (Specs) first with an Ignore attribute with the text "Pending". then my test runner shows me my task list. and it is tied DIRECTLY to my code, so it fails until I have the code that makes it pass.

A little googling for BDD should get plenty of resources.

~Lee
4/18/2009 2:39 PM | Lee Brandt
Gravatar

# re: TaskList in Visual Studio - Making it better

Thanks Lee. Thats sounds awesome. I would love to try that.
4/18/2009 2:51 PM | Elroy
Gravatar

# re: TaskList in Visual Studio - Making it better

"With Visual C# and Visual J# projects, the Task List displays only the comments that are found in the files currently opened for edit."

Yeah this "feature" sucks. But it has been resolved in VS 2008 SP1.
I just tested it with C#, but it seems that now all the comments of the project are displayed.
6/29/2009 7:46 AM | Julien
Gravatar

# re: TaskList in Visual Studio - Making it better

Sorry for this second comment, but I just found something :

"User Tasks to be more specific (by having a file anchor like ‘Comments’) to allow user tasks to be associated with a particular line in code."

You can use this feature : Edit, Bookmarks, Add Task List Shortcut.
It creates a task (in a specific category "Shortcuts", too bad) that is linked to the selected line of code. By default the task's text is set to the current line's text but you can change it.

This could be a workaround.
6/29/2009 8:05 AM | Julien
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: