IDEA settings document comments
1. Reference materials
- IDEA class and method annotation template settings (very detailed)
- Idea comment template configuration (hematemesis recommended!!!)
2. Class documentation comments
2.1, set the document annotation template
Set the documentation comment of the class on the [File and Code Templates] page
/**
*@ClassName ${NAME}
*@Description TODO
*@Author ${USER}
*@Date ${DATE} ${TIME}
*@Version 1.0
*/
2.2, use class documentation comments
Note: Only when you create a new class , you can create the documentation comment of the class.
3. Set interface documentation notes
3.1, set the interface document annotation template
In the same way, set the interface document comment on the [File and Code Templates] page
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
/**
*@InterfaceName ${NAME}
*@Description TODO
*@Author Oneby
*@Date ${DATE} ${TIME}
*@Version 1.0
*/
public interface ${NAME} {
}
3.2, use interface documentation notes
Note: Only when you create a new interface , you can create an interface documentation comment.
4. Method documentation notes
4.1, setting method document annotation template
-
Create a new template in [Live Templates]
-
By default, a new group named user will be created (I am too lazy to change the name)
Abbreviation:*
Means to input on the method*
, and then press Enter to appear the method document comment- Description: Add documentation comments for the method
- Template Text: template content
- Applicable in Java: Only effective in Java files
-
Add default values for variables on the template
-
Template for method documentation
** * @description: $description$ $params$ * @return: $returns$ * @author Oneby * @date: $date$ $time$ */
-
params
Ofdefault value
:groovyScript("def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {result+='* @param: ' + params[i] + ((i < params.size() - 1) ? '\\n ' : '')};return result", methodParameters())methodParameters())
4.2, use method documentation notes
Nice~~~