TODO lists
View | Tool Windows | TODO
JetBrains Rider provides an easy way to track tasks and technical debt in your code — code items (comments, string literals, or identifiers) matching a specific pattern can be easily located in the editor as well as in the whole solution using the TODO window.
![JetBrains Rider: TODO window JetBrains Rider: TODO window](https://resources.jetbrains.com/help/img/rider/2024.3/TODO_window.png)
tip
If you do not want to add a TODO comment, consider marking the code line with a bookmark.
TODO items are highlighted in the editor and on the error stripe according to their types (Edit, Normal, Question, Warning, Error). Colors are configurable on the Editor | TODO settings page CtrlAlt0S.
By default, JetBrains Rider provides three predefined patterns for commonly used TODO items of the following types:
A line in a comment containing
TODO
orTODO: some description
(both case-insensitive) - NormalA line in a comment containing
BUG:
(case sensitive) - ErrorA
NotImplementedException
in the code - Edit
You can also define your own patterns, so that you could quickly access your specific technical debt items in the TODO window.
tip
If you are going to use custom TODO patterns, it could be a good idea to create a live template for quickly inserting these custom TODOs into your code.
Open the Editor | TODO page of JetBrains Rider settings CtrlAlt0S.
Click Add on the toolbar.
Specify a regular expression with keywords that you want to detect in comments. For example,
(\W|^)(?<TAG>Refactor)(\W|$)(.*)
.Optionally, specify whether the pattern is case-sensitive.
Select an icon for the pattern to define how matched items will be colored in the editor and in the TODO window.
Click OK to add this pattern to the list.
You can also edit or remove existing patterns.
Click Save in the Settings dialog to apply the modifications and let JetBrains Rider choose where to save them, or save the modifications to a specific settings layer by choosing this layer from the Save selector. For more information, see layer-based settings.
By default, TODO items in comments can be multi-line if the following lines are indented from the first line with at least one whitespace:
// TODO: beginning of the comment,
// comment continued on the next line
If you want to have only single-line TODO items in comments, you can clear the Treat indented text on the following lines as part of the same TODO on the Editor | TODO page of JetBrains Rider settings CtrlAlt0S
To navigate between TODO items in the current file, use TODO marks on the error stripe.
Press Alt06 or choose View | Tool Windows | TODO in the main menu.
In the TODO window that opens, click
or
to navigate to the next or previous item.
To locate TODO items in the editor, double-click them , press F4 or choose Jump to Source in the context menu .
Optionally, you can turn on Navigate with Single Click
so that items are located in the editor as soon as they get focus in the tool window.
To study the source code of the selected item right in the window, click Preview Source
on the toolbar.
Depending on the size and age of the codebase, there may be lots of TODO items. To focus on specific items, you can filter TODO items by scope or by custom filters.
Initial filtering is available with the tabs of the TODO window:
You can use the Current File tab to see just the TODO items in the file active in the editor.
The Default Changelist tab becomes available when you enable VCS integration for the current solution; this tab will list TODO items from files with uncommitted local changes.
In the Scope Based tab, we can use the Scope selector to pick places where Rider should search for TODO items. You can also click ... to create your own scope.
Further filtering is available with custom filters, which let you create groups of TODO patterns that you are interested in.
You can create custom filters either on the Editor | TODO page of JetBrains Rider settings CtrlAlt0S or by clicking on the filter icon in the TODO window and choosing Edit Filters.
To cycle through the tool window tabs, press CtrlAltPg Dn and CtrlAltPg Up.
Icon | Tooltip and shortcut | Description |
---|---|---|
Previous TODO ShiftF8 | Select the previous TODO item in the list. | |
Next TODO F8 | Select the next TODO item in the list. | |
Filter TODO Items | Select a filter or open the TODO dialog where you can edit the list of TODO patterns and filters as necessary. | |
Navigate with Single Click | When this toggle is selected, you can click items to open items in the editor. Otherwise, you can locate items in the editor by double-clicking them or pressing F4. | |
Expand All CtrlNumPad + | Click this button to expand all nodes. | |
Collapse All CtrlNumPad - | Click this button to collapse all nodes. | |
Group by Project | Use this toggle to group TODO items by containing projects. Not available for the Current File tab. | |
Preview Source | Show a preview pane with the source code of the selected item in the corresponding file. |
Item | Description |
---|---|
Jump to Source F4 | Jump to the location of the relevant comment in the source code. Available only when you right-click a TODO item or a file. |
Local History | Show the Local History submenu:
|