Tag: is the content match add temp var androi enc tag
1. Add a custom todo tag
Preferences, click the plus sign in the lower left corner and enter the TODO that you want to customize.
Input \bX\b.*
(x is the name of the TODO tag), here in To_complete for example, enter\bto_complete\b.*
?
?
To remove the DefaultColor, you can customize the intuitive color:?
Two steps you can manually enter and use the custom todo, but the input is not very convenient, in order to facilitate the use, you need to use a dynamic template
2. Add Dynamic Templates
Preferences, Editor, Live Templates, add a new template:
?
- In the panel below, fill in the corresponding content, namely: abbreviation, description, template text.
- The template text is
// TO_COMPLETE: $date$ $tocomplete$
, preceded by matching our Todo tag, followed by using data to declare a date variable, using Tocomplete to declare the variable that describes the agent, the variable is used for the placeholder, the following to assign value
- Notice the edit variables on the right, which is editing the variable. Click this button to open the Edit Template Variables panel. Table, four columns correspond to: variable name, expression, default value, skip if defined.
- ?
- The date variable's expression is set to date (), and the current date is used to fill in the placeholder for the variable, and the Skip option is checked to indicate that the value is not edited by itself.
- At the same time, the TODO variable is used to add a description and cannot be assigned with a fixed expression, so I chose to give the default value "Wait here to finish" and did not tick "skip". In this case, I will be assigned the "Wait Here for completion" by default, but my cursor will still be there: I can choose to continue editing, or return to use the default value
- You also need to define the context in which the template is used, that is, where you can call out code templates by abbreviations.
- Below the interface, there is a text: No applicable contexs yet. followed by a Define, click on the popup template to use the context list. We generally add refactor TODO in Java code, so select Java, and you can choose as you want.
- Finally, you can check the right side of the refactor according to style, indicating that the automatic formatting code (adjust alignment, indentation, etc.), click OK to complete and exit
In this way, you can enter comp ... in the place where you need to add the refactoring logo, and the smart tips will come out when you enter the process.
3. Adding filters
When you have a lot of custom Todo in your project and you mix it up, it's hard to find it, so we can use the filter feature to quickly sort through different custom todo.
To add filters first, click the funnel on the left side of the TODO window, select Edit Filters, and add the filters as shown:
?
Once added, click the funnel again, select the filter you just added, and in the TODO view you'll only see the corresponding custom TODO items
?
Androidstudio Customizing Todo