Mar*_*mus 8 formatting intellij-idea
我正在尝试格式化以下Javadoc,但我无法弄清楚如何.
输入示例:
/**
* Headline.
* <p>
* Lorem ipsum dolor sit amet,
* consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
* <p>
* A list:
* <ul>
* <li>The description above should be wrapped at the right margin, and broken lines should be joined.</li>
* <li>A line starting or ending in a tag should not be joined.</li>
* </ul>
*
* @author Mark Jeronimus
*/
Run Code Online (Sandbox Code Playgroud)
当我按'格式'时我想看到这个:
/**
* Headline.
* <p>
* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
* ut labore et dolore magna aliqua.
* <p>
* A list:
* <ul>
* <li>The description above should be wrapped at the right margin, and broken lines should
* be joined.</li>
* <li>A line starting or ending in a tag should not be joined.</li>
* </ul>
*
* @author Mark Jeronimus
*/
Run Code Online (Sandbox Code Playgroud)
Eclipse和NetBeans可以轻松完成此任务.IntelliJ,如果我将它配置为包装文本(我需要)它也加入标签,除了<p>.(设置 - >编辑器 - >代码样式 - > Java - > JavaDoc - >其他 - >右边距换行).它看起来像这样:
/**
* Headline.
* <p>
* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
* ut labore et dolore magna aliqua.
* <p>
* A list: <ul> <li>The description above should be wrapped at the right margin, and broken
* lines should be joined.</li> <li>A line starting or ending in a tag should not be joined.
* </li> </ul>
*
* @author Mark Jeronimus
*/
Run Code Online (Sandbox Code Playgroud)
我试着改变其他设置,希望它们中的一些相互干扰,无济于事.
我不想要的是使用Eclipse Formatter插件.我觉得IntelliJ应该能够处理这样的基本行为,或者有人应该如何以正常方式格式化他们的Javadoc?
设置以下选项
\n\n\n空行
\n
\n \xe2\x9c\x93 描述后这是 javadoc 标准,其他空行是可选的
\n 其他
\n \xe2\x9c\x93 在右边距换行
\n \xe2\x9c\x93 启用前导星号
\ n \xe2\x9c\x93 在空行上生成“<p>”
\n \xe2\x9c\x93 保留空行
\n \xe2\x9c\x97 保留换行符
单击“确定”
当然,您可以根据自己的喜好调整偏好。此设置将重新对齐文本以适合边距,但在格式化之前您必须将 <ul> 标记放在新行上。
\n| 归档时间: |
|
| 查看次数: |
368 次 |
| 最近记录: |