IDEA2020.3.2 version automatic annotation class and method annotation template configuration

**

IDEA2020.3.2 version automatic annotation class and method annotation template configuration

**I
want to come to you to often annotate classes and methods yourself in a learning or development environment; let me explain how to create your own annotation templates for you:

1. Automatic annotation of configuration class

1. Open the idea file–>Settings–>
Insert picture description here
2. Follow the steps in the figure below: directly search for file and code–>click File and Code Templates–>click the files file type–>and then select the Class file template to edit your own ideas in the navigation bar The desired template -> click apply to apply -> click ok. If you want to set the method template, don't rush to click ok.

Class annotation code piece: modify according to your actual needs

/**
 * @description:常量
 * @author: zhangzhixiang
 * @createDate: ${DATE} ${TIME}
 */

2. Configuration method annotation template

1. Search for file and code -> click on the Live template below or search for Live template directly; -> then click on the small plus sign on the right
Insert picture description here

2. Select the new template-"Template New Group
Insert picture description here
3. Create the template name
Insert picture description here
4. Find and select the template you created -" click the small plus sign on the right and select Live template
Insert picture description here
5. First enter the shortcut key you want in Abbreviation- "Recommended to use. or / or the like is simple and easy to use, description is the remarks of the template-"Enter the template you want in the box-"Then click Define to set the programming language (be sure to set otherwise the code will not take effect)

Template code piece: modify according to your actual needs

/**
 * 方法描述
 * @author gonghaichao
 * @date $date$ $time$
 * @params *@params $params$
 * @return $returns$
 */

Insert picture description here

The choice here is java—"click expand with to set the shortcut key for calling out; when using the annotation, call out through the Abbreviation name + the shortcut key set: for example, here is to call out the annotation through the /+Tab key.
Insert picture description here

.–》Click Edit variables, set the display parameters you want, date, time, params return parameters, returns return type.
Insert picture description here
Actual demonstration diagram: The class annotation will automatically appear when the class is created, and the method annotation will be called out through the shortcut key set by yourself. This is the
Insert picture description here
first time you write a blog with /+Tab (template name +Tab) . You are welcome to point out the bad writing. Make progress together!

Guess you like

Origin blog.csdn.net/m0_52283848/article/details/115327717