How to create more notes like TODO in Android Studio, for example CHECK or TEST?

拥有回忆 提交于 2019-12-04 04:09:11

Yes, this is possible. Android Studio is based on IntelliJ and you can find a instruction on how to add a new pattern here:

https://www.jetbrains.com/help/idea/defining-todo-patterns-and-filters.html

From the link:

  1. In the TODO tool window, click the Filter TODO Items icon (Filter TODO Items) and then click Edit Filters to open the TODO dialog.

  2. To add a pattern for the OPTIMIZE items, click the Add icon (Add) in the Patterns section of the TODO dialog, and type the following pattern: \boptimize\b.* Then click OK to save the new pattern.

  3. To add a filter with the new pattern, click the Add icon (Add) in the Filters section of the TODO dialog, specify a name for the new filter, and select the new pattern to be included in this filter. Then click OK to save the new filter.

  4. Click OK to apply changes in the TODO dialog.

  5. To apply the new filter, in the TODO tool window, click the Filter TODO Items icon (Filter TODO Items) and select the necessary filter.

FWIW - While playing around with this I found that you can also bundle the keywords.

For example: If you create a pattern like \binfo\b.* it will be for the //INFO tag.

Then start the comment like: //INFO: it will show in the TODO list as //INFO: If you start the line with //INFO TODO: it will show in the TODO window as //INFO TODO It will also show as //INFO TODO: so it shows up twice with different patterns bolded.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!