How do I add a high-priority TODO comment in Visual Studio?
Solution 1
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
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)
aarona
Updated on December 04, 2021Comments
-
aarona over 2 years
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?
-
aarona about 13 yearsI see these options.. but the Add button is disabled! Do you have the same behavior?
-
thomson_matt about 13 yearsType in a name in the "Name" box, and then the "Add" button will be enabled.
-
aarona about 13 yearsThanks. Also, what a way to start your StackOverflow exp with 80 rep :D
-
toddmo over 9 yearsMicrosoft, that's dumb. I had to add 6 more tags, 3 high and 3 low.
-
Richard C over 7 yearsThis is one way of doing it, but it assumes that only one person is going to be looking at the task list, or all team members have done the same setup. Is there a way to configure this on a project or solution level so that everyone getting the source has it?
-
AmiNadimi about 7 yearsI have added a new tag and i want it to get BLUE! just as TODO and BUG tags . anyone knows how ?
-
AmiNadimi about 7 yearsOK! Found it myself. it was a resharper thing so i went to resharper menu > Options > Tools > To-do Items then add the item, give it a title and a color and also a regular expression like
(?<=\W|^)(?<TAG>your custom tag)(\W|$)(.*)
and hit save. -
Preza8 over 4 yearsBy the way, it does not prefer high priority but judges it by the first tag found. If you use // TODO BUG and BUG is your high priority task tag, it will still be normal because TODO is first and it is normal. I find this a little dumb.
-
Donny McCoy over 4 yearsLogged in just to acknowledge this and raise it back up in case others are searching. Having used the TODO for numerous versions, I just learned something new, and I'm fast becoming an old dog!
-
user3285954 almost 4 yearsAre the custom tags working in VS2019? I added a few and none show up in task list.