Since there isn't a page for 2012 and 2010 is pretty close I used these instructions
I wrote the below but I see an empty task list. How do I properly do this? Note: "Enumerate Comment Tasks" is set to true.
void myfunc() {
...
// TODO Fix this function.
...
VS 2012, 2010, 2008: When you switch to the Task List window, the topmost control is a drop-down list. Switch it from "User tasks" to "Comments". Your TODOs in your comments should appear. In case of C++ there are some constraints, look at my specific C++ answer.
For C++ the enumeration is turned off by default for performance reasons: link. See also: link. But if I enable the switch mentioned in the other StackOverflow topic, I still didn't see all of the TODOs. I have to actually open up a file with TODOs, and then I see only the TODOs in the currently open files.
Related
Our codebase has a bunch of TODO comments that no one will ever fix and that the boss refuses to remove.
I would like to hide the TODO's from the Visual Studio task list and just show my custom MEDO tags.
It appears that Visual studio will not let you remove the TODO tag from the task list. The remove button is grayed out for TODO. (You can remove all the other default tags, just not TODO.)
Does anyone know some kind of hack or something that will allow me to remove them anyway? Maybe editing some config file somewhere?
As you've discovered, Visual Studio won't allow you to modify the TODO token, but you can trick it by using the Priority settings to filter it out.
First, set your MEDO token to "High Priority" as shown here:
Then filter the Task List window to only show high priority items. (The filter button is hard to see on that column - you may need to widen it a bit.)
By default, Visual Studio includes the following tokens: HACK, TODO, UNDONE, NOTE.
All you need to do is to remove the TODO from these list of predefined tokens. (you can create your own tokens as well)
On the Tools menu, choose Options.
Open the Environment folder and then choose Task List and then delete the TODO token.
So now you will continue to have TODO comments in your codebase but they will not show in your task list.
I am aware you can use the special comments
//TODO: Something to be done...
and then see them in View-> Task List
But is there a way for me to add a comment with a different custom name and also see it in the Task List?
For example
// WorkIP:
Thanks,
It is called "custom comment tokens" and it is actually explained pretty clearly over here.
In short, you can add and edit them by going in Visual Studio to
Tools->Options->Environment->Task List
You can also select the priority of the comment token in there.
According to this, VS 2008 and 2010 had a feature called Comment Tokens. You can write // TODO document this magic number here and it will appear in your Comments section of the Task List. This part works for me.
However, that article says that you can even define your own tokens, by going to Tools>Options>Environment>Task List .
However, in my Visual Studio 2010 Ultimate, I don't have that option.
How do I make custom comment tokens?
Just check the "Show all settings" checkbox you see at the bottom left of the Options dialog. You now should be able to navigate to "Environment | Task List" to create your custom comments. Here is an additional link How to: Create Custom Comment Tokens
So, I have TODO comments showing up in my task list as long as the TODO comment is in a C# file. The TODO comments in HTML, CSS, or JScript aren't showing up in my Task List. Is there a way to enable this in Visual Studio 2010 Pro?
Simple answer: NO.
From: How to: Create Task List Comments
The Task List displays comments in your code that begin with the
comment marker for your development language. Next to the comments,
the Task List also displays a default task token, such as TODO, HACK,
or UNDONE, or a custom comment token. The number of comments that
appear in the Task List may change, depending on the type of project
you are working on. With Visual Basic and Visual C#, the Task List
displays all the comments in the solution. With Visual C++ projects,
the Task List displays only the comments that are found in the file
that is currently active in the editor.
So it is only supported in VB, C# and C++ projects.
With Resharper, which you should have if you don't, has the todo list window your looking for. It parses all the those files (js, css, html, c#, etc.). You can dock that window with all your other windows.
<% //TODO: page side task %>
i.e. escape to code and then use that language's tasking comment.
So, then alternatively:
<% 'TODO: page side task for VB %>
Note Arun's caveat about it only showing with the page open, which might be why "NO" is the top answer, because it doesn't fully accomplish what was asked.
(In fact this really just expands his answer, but I didn't yet have the points to make it a comment.)
It works in Visual Studio 2015
Only issue is that, that particular page is needed to be opened to view the tasks.
Add Task as in normal C#
//TODO: this is javascript task
I'm trying to get my TODO comments to show up in the task list in Visual Studio 2010 for a C++ project, but they don't. I looked at this, but see no caveats other than the TODO comments need to be in the currently-open file. For example, creating a new Win32 console app places this:
// TODO: reference additional headers your program requires here
in a new file, stdafx.h. However, there's nothing in the task list.
I have "Comments" chosen from the drop-down in the task list, but it's always empty. And it's not this problem; I can open the file and be looking at the TODO comment in the code editor and no task is shown. This is not a problem for C# projects as TODO comments show up as designed in those projects; this appears to be an issue specific to C++ projects.
What else can I check?
This is off by default 'for performance reasons'. Tools + Options, Text Editor, C/C++, Formatting, Miscellaneous, Enumerate Comment Tasks = True. Feedback article is here.
Also note the comment in the MSDN article about task list comments:
With Visual C++ projects, the Task
List displays only the comments that
are found in the file that is
currently active in the editor.
This is what I got from MSDN:
Hi,
The ‘comments tasks’ in the Task List window is turned off by default
due to performance reasons. You can turn this feature on from
Tools->Options->Text Editor->C/C++->Formatting->
Miscellaneous->Enumerate Comment Tasks.
We apologize for the inconvenience.
Thanks Sumit Kumar Visual C++ Team