rkc*_*cpi 81 javadoc intellij-idea
我正在从Eclipse迁移到Intellij Idea.我无法弄清楚的一件事是@authorJavaDoc标签的自动完成.@a在Eclipse中键入时,有两个提议:
@author - author name
@author
Run Code Online (Sandbox Code Playgroud)
我如何在Intellij中实现第一个提案(甚至可能吗?)?如果可能,如何更改为作者姓名占位符插入的内容的模板?
lev*_*tor 207
还有一个选项,不完全是你问的,但可能有用:
转到Settings- > Editor- > File and code templates- > Includes选项卡(右侧).新文件有一个模板标题,您可以在此处使用用户名:
/**
* @author myname
*/
Run Code Online (Sandbox Code Playgroud)
对于系统用户名:
/**
* @author ${USER}
*/
Run Code Online (Sandbox Code Playgroud)
Len*_*art 66
您可以通过实时模板解决这个问题.转到设置 - >实时模板,单击"添加" - 按钮(右侧的绿色加号).
在"缩写"字段中,输入应激活模板的字符串(例如@a),并在"模板文本"区域中输入要完成的字符串(例如@author - My Name).将"适用的上下文"设置为Java(仅限注释)并设置完成的键(在右侧).
我测试了它并且工作正常,但是IntelliJ似乎更喜欢inbuild模板,所以"@a + Tab"只完成"作者".Space但是,将完成键设置为有效.
要更改通过文件模板自动插入的用户名(例如,在创建类时),可以通过添加来更改
-Duser.name=Your name
到IntelliJ/bin目录中的idea.exe.vmoptions或idea64.exe.vmoptions(取决于您的版本).
Sud*_*ary 10
对于 Intellij IDEA Community 2019.1,您需要执行以下步骤:
File -> New -> Edit File Templates.. -> Class -> /* Created by ${USER} on ${DATE} */
这里只是回答一些问题:
您还可以添加采用以下值的预定义变量:
${PACKAGE_NAME} Name of the package in which the new file is created
${USER} Current user system login name
${DATE} Current system date
${TIME} Current system time
${YEAR} Current year
${MONTH} Current month
${MONTH_NAME_SHORT} First 3 letters of the current month name. Example: Jan, Feb, etc.
${MONTH_NAME_FULL} Full name of the current month. Example: January, February, etc.
${DAY} Current day of the month
${DAY_NAME_SHORT} First 3 letters of the current day name. Example: Mon, Tue, etc.
${DAY_NAME_FULL} Full name of the current day. Example: Monday, Tuesday, etc.
${HOUR} Current hour
${MINUTE} Current minute
${PROJECT_NAME} Name of the current project
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
76414 次 |
| 最近记录: |