Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaDoc Styling is incomplete #73

Open
cmm0004 opened this issue May 28, 2020 · 9 comments
Open

JavaDoc Styling is incomplete #73

cmm0004 opened this issue May 28, 2020 · 9 comments

Comments

@cmm0004
Copy link

cmm0004 commented May 28, 2020

This style should be unchecked

image

@cmm0004
Copy link
Author

cmm0004 commented May 28, 2020

this is intellij 2019.3

@JakeWharton
Copy link
Collaborator

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
Copy link
Collaborator

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.

@egraham-square
Copy link

egraham-square commented May 28, 2020

@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.

@JakeWharton
Copy link
Collaborator

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
Copy link
Collaborator

🤦

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

@JakeWharton
Copy link
Collaborator

Take 2

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

@egraham-square
Copy link

egraham-square commented May 28, 2020

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

@egraham-square
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants