Using the Task List
Use the Task List to create and manage tasks, add and track code comments that use tokens such as TODO and HACK, and manage shortcuts that will take you directly to a predefined location in the code.
In this topic:
The Task List window
When the Task List is open, you can choose to display user tasks, comments, or shortcuts. The Task List window appears at the bottom of the application window.
To open the Task List
On the View menu, choose Task List (Keyboard: Ctrl+\,T).
To display user tasks, comments, or shortcuts
Open the Categories drop-down list, and then choose User Tasks, Comments, or Shortcuts.
Note
The options will change based on the programming language you are using and whether or not there are shortcuts set in your code.
You can also customize how the content is displayed by changing the sort order the list, showing or hiding columns, or changing the order in which the columns appear.
To change the sort order of the list
Click the header of any column. To further refine your search results, press Shift and click a second column header.
As an alternative, on the shortcut menu, choose Sort by, and choose a header. To further refine your search results, press Shift and choose a second header.
To show or hide columns
- On the shortcut menu, choose Show Columns. Choose the columns that you want to show or hide.
To change the order of the columns
- Drag any column header to the location that you want.
User tasks
User tasks are reminders about work that you want to do or issues that you want to address. You can create user tasks, mark them as complete, and then delete them when they are no longer needed.
To create a new user task
With User Tasks selected in the Category drop-down list, choose the Create User Task button in the upper-right corner of the Task List window.
Type a description of your user task, and then press Enter.
To change the priority of a user task
Click in the Priority column to the left of a task, and then select a new priority setting.
To mark a user task as complete
- Select the check box to the left of a user task.
To remove a user task from the list
- Choose a user task. On the shortcut menu, choose Delete.
Tokens and comments
A comment in your code preceded by a comment marker and a predefined token will also appear in the Task List window. For example, the following C# comment has three distinct parts:
The comment marker (//)
The token (TODO)
The comment (the rest of the text)
//TODO: Load state from previously suspended application
Because TODO is a predefined token, when you choose to display Comments in the Task List, this comment also appears as a TODO task in the list.
To create a new comment
- In the code, type the comment marker for your code (for example, type // for C# code), a token such as TODO, HACK, or UNDONE, and then complete the comment.
Tip
After you have created the comment, you can double-click the comment in the Task List window to locate it in the corresponding code.
As an alternative, to navigate through the comments in the code, choose a user task in the list, then choose Next Task or Previous Task from the shortcut menu.
Custom tokens
By default, Visual Studio includes the following tokens:
HACK Indicates a workaround.
TODO Indicates something to be done.
UNDONE Indicates a reversal or "roll back" of previously changed or updated code.
You can also create your own custom tokens.
To create a custom token
On the Tools menu, choose Options.
Open the Environment folder and then choose Task List.
The Task List, Environment, Options Dialog Box is displayed.
In the Tokens category, in the Name text box, enter your token name.
In the Priority drop-down list, choose a default priority for the new token. Choose the Add button.
C++ TODO comments
By default, C++ TODO comments are not displayed in the Task List window.
To display C++ TODO comments
On the Tools menu, choose Options.
In the Options dialog box, open Text Editor.
Under C/C++, choose View, and then set Enumerate Comment Tasks to True.
Shortcuts
A shortcut is a bookmark in the code. Double-click the shortcut in the Task List to go to the corresponding location in the code.
To create a shortcut
Insert the pointer into the code where you want to place a shortcut. On the Edit menu, choose Bookmarks, and then choose Add Task List Shortcut (Keyboard: Ctrl+K, Ctrl+H).
As an alternative, to navigate through the shortcuts in the code, choose a shortcut in the list, and then choose Next Task or Previous Task from the shortcut menu.