一。 類注釋
/**
* @description:
* @author: ${USER}
* @email: xxx@163.com
* @date : ${DATE} ${TIME}
*/
二。 方法注釋
到 file-settings-editor-live templates中:
1、點擊 右側 + 號 ,選擇 template group
2、輸入新建組的名稱(隨便輸入名稱),比如 CustomTemplates
3、點擊新建的組
4、點擊 右側 + 號 ,選擇 live template ,輸入Abbreviation值(這是在代碼中調用注釋體的快捷鍵 我這里設置的是 methcmnt)
5、按照格式輸入
/**
* @description: $desc$
* @param: $methodParameters$
* @return: $methodReturnType$
* @author: $user$
* @time: $date$ $time$
*/
6、點擊 edit variables 按鈕
7、輸入屬性值, 如將name為user的表達式設置為user(),即可自動顯示作者名,date()自動顯示最新日期:
8、保存即可
參考: https://blog.csdn.net/u014390957/article/details/83113435
https://blog.csdn.net/chenhy24/article/details/84567510