IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

TODO comments

Last modified: 15 June 2021

Default patterns: TODO and FIXME

Configure: Settings/Preferences | Editor | TODO

Tool window: View | Tool Windows | TODO

Sometimes, you need to mark parts of your code for future reference: areas of optimization and improvement, possible changes, questions to be discussed, and so on. IntelliJ IDEA lets you add special types of comments that are highlighted in the editor, indexed, and listed in the TODO tool window. This way you and your teammates can keep track of issues that require attention.

Example of TODO comments

By default, there are two patterns recognized by IntelliJ IDEA: TODO and FIXME in both lower and upper case. These patterns can be used inside line and block comments of any supported file type. You can modify the default patterns or add your own patterns if necessary.

To create a multiline TODO item, indent the comment lines that follow the initial line. Without the indent, lines are treated as regular comment lines. To disable multiline TODO items, in the Settings/Preferences dialog Ctrl+Alt+S, go to Editor | TODO and clear the Treat the indented text on the following lines as part of the same TODO checkbox.

To view TODO items, open the TODO tool window: View | Tool Windows | TODO. Use tabs to change the source of TODO items you want to view: from all files in your current project, only those in the current file, based on a certain scope of files, or from files in the active changelist (if you have version control integration configured).

To jump to a TODO comment in the source code, click the corresponding TODO item in the TODO tool window. To disable this behavior, use the Navigate with Single Click button The Navigate with Single Click button on the toolbar (in this case, you will need to double-click the TODO item to jump to the relevant comment).