问题
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:
In the TODO tool window, click the Filter TODO Items icon (Filter TODO Items) and then click Edit Filters to open the TODO dialog.
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.
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.
Click OK to apply changes in the TODO dialog.
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