Androidstudio Customizing Todo

Source: Internet
Author: User

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:
?

    1. In the panel below, fill in the corresponding content, namely: abbreviation, description, template text.
    2. 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
    3. 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.
      1. ?
      2. 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.
      3. 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
    4. You also need to define the context in which the template is used, that is, where you can call out code templates by abbreviations.
      1. 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.
    5. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.