Here is a javadoc comment that I wrote:
/**
* This utility allows the user to do the following.
* <ul>
* <li>A cool feature</li>
* <li>Another cool feature</li>
* </ul>
*/
public static void main(String[] args) {
Here is the same comment, reformatted by intelliJ
/**
* This utility allows the user to do the following.
* <ul>
* <li>A cool feature</li>
* <li>Another cool feature</li>
* </ul>
*/
public static void main(String[] args) {
How can I prevent the autoformat feature from clobbering my intentations?
In order to prevent IntelliJ from removing my newlines, I checked a box:
Settings > Editor > Code Style > Java > JavaDoc > Preseve Line Feeds
I wish there was a "Preseve leading whitespace" box in the same place, but there isn't.
` fragment with properly indented source code inside Javadocs, IntelliJ wipes spaces out. Upvote for "reserve leading whitespaces" checkbox. – uvsmtid Jun 19 '20 at 04:23
` case - see [this answer](https://stackoverflow.com/a/542142/441652). IntelliJ does not remove whitespaces if `@code` tag is used. But this HTML case still remains as it's not part of code but rich text formatting. – uvsmtid Jun 19 '20 at 04:31