java-code-styles icon indicating copy to clipboard operation
java-code-styles copied to clipboard

JavaDoc Styling is incomplete

Open cmm0004 opened this issue 5 years ago • 9 comments

This style should be unchecked

image

cmm0004 avatar May 28 '20 13:05 cmm0004

this is intellij 2019.3

cmm0004 avatar May 28 '20 13:05 cmm0004

Can you illustrate what that would change?

My best guess is that it changes the behavior from

/**
 * Foo
 * <p>
 * Bar
 */

to

/**
 * Foo
 *
 * <p>Bar
 */

which is not what we want.

Oracle's Javadoc guide recommends the <p> be placed on its own line. I can't find the link right now, but I have in the past when this has come up.

JakeWharton avatar May 28 '20 13:05 JakeWharton

Here's a link: https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#format

It's not the one I'm thinking of, but it does illustrate that <p> goes on its own line.

JakeWharton avatar May 28 '20 14:05 JakeWharton

@JakeWharton, not quite.

When that setting is unticked you have this (empty line allowed to stay empty):

/**
 * Foo
 * 
 * Bar
 */

Once ticked, the autoformatter inserts <p> on the empty line:

/**
 * Foo
 * <p>
 * Bar
 */

I just checked 2019.1, and it looks like it's unticked by default with the Java Code Styles there, so it must have changed at some point between that version and 2019.3.

egraham-square avatar May 28 '20 14:05 egraham-square

I have a fresh 2020.2 EAP installation from today into which I installed the styles and the checkbox is ticked for me:

Screen Shot 2020-05-28 at 10 41 54 AM

JakeWharton avatar May 28 '20 14:05 JakeWharton

🤦

Whoops. Forgot to restart to actually get the styles...

JakeWharton avatar May 28 '20 14:05 JakeWharton

Take 2

Screen Shot 2020-05-28 at 10 54 26 AM

JakeWharton avatar May 28 '20 14:05 JakeWharton

Ah interesting. Was this an intentional change to the Java Code Style? Or an oversight?

egraham-square avatar May 28 '20 15:05 egraham-square

huh, so I see now that the settings repo isn't specific to any IJ version. And it looks like the setting we're talking about is already false (the desired behavior) in the repo:

<option name="JD_P_AT_EMPTY_LINES" value="false" />

So I'm at a loss as to why it's defaulting to true in some cases. Will try to replicate tomorrow.

egraham-square avatar Jun 06 '20 03:06 egraham-square