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

岁酱吖の 提交于 2019-12-05 19:03:36

问题


Does anybody know how to create new tags similar to the "TODO" in Android Studio? I mean so that they would highlight as well and appear in the list of issues. I'd appreciate any tip or suggestion.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/45373313/how-to-create-more-notes-like-todo-in-android-studio-for-example-check-or-test

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