How do I add a high-priority TODO comment in Visual Studio?

Visual StudioVisual Studio-2008CommentsTaskTodo

Visual Studio Problem Overview


Adding a comment such as this:

// TODO: Refactor this code

...creates a task in the Task List that I can view etc. There is a column labeled ! that lets you sort these tasks by priority.

How can I set a specific task's priority?

Visual Studio Solutions


Solution 1 - Visual Studio

The priority of the task depends on the keyword you use to tag it. You can see and edit a list of keywords and their priorities by going to Tools->Options->Environment->Task List.

For example, on my installation, I've got HACK, TODO and UNDONE as normal priority, and UnresolvedMergeConflict as high priority.

If you want to add a new tag, type it into the "Name" box, choose a priority, and then click "Add".

Solution 2 - Visual Studio

A cheap hack is to always put a priority just after the the TODO tag, then sort by description. Only use priority 1-9 to avoid alphabetic sorting confusion.

Any comments without a priority will drop to the bottom.

(Click to enlarge the image)

TODO priority hack

Solution 3 - Visual Studio

A very simple way/hack to define the priority is the number of Os at the end of TODO, then you sort the task List by "Description".

Pros:

  • No need to restrict yourself at 1 or 2 digit numbers
  • It's funnier than 1-9

I got this idea from a video by Tsoding where he talks about it being an extension for emacs. Link in the video description.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionaaronaView Question on Stackoverflow
Solution 1 - Visual Studiothomson_mattView Answer on Stackoverflow
Solution 2 - Visual StudioRockResolveView Answer on Stackoverflow
Solution 3 - Visual Studiouser17585536View Answer on Stackoverflow