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

allow javadoc comments before and after enum values #15202

Merged
merged 1 commit into from
Jun 6, 2021
Merged

allow javadoc comments before and after enum values #15202

merged 1 commit into from
Jun 6, 2021

Conversation

nomuna
Copy link
Contributor

@nomuna nomuna commented Jun 3, 2021

Fix #15185


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@MathieuAA
Copy link
Member

LGTM, I have one question: do you want the comments to appear in the generated files as well?
If that's the case, then a bit more work is needed.

@nomuna
Copy link
Contributor Author

nomuna commented Jun 4, 2021

@MathieuAA As far as the description of this bug goes the issue is that the parser is causing an issue
since the grammar doesn't allow comments next to the enum values. There is no information if they want it in the
generated java code.

They are right that it was documented as possible but not really working.

Current state is that even the comments on enum itself is also not carried over to the java code.

/** This comment will be taken into account */
enum Country {
  // But not this one!
  FRANCE
}

As I understood in this issue, there is no information if they want the comments to be in the generated java classes. So as for this specific case the PR is complete, I think?

In #14869 they want it in the swagger info. I am not even sure if it is doable. So I guess my PR only solves the
parser issue for #14869. So may be I should update my PR to remove the 'Fix #14869' from the comment.

Example from #14869

enum myEnum { V1 /** value1 */, V2 /**value2 */, V3 }

Their example doesn't contain a javadoc for V3. As a rule for javadoc the comment should precede the enum keys but they
write it in the back which makes me think we should may be just allow javadoc in front of an enum key.

@MathieuAA
Copy link
Member

@nomuna great, thanks!

@MathieuAA
Copy link
Member

In #14869 they want it in the swagger info. I am not even sure if it is doable. So I guess my PR only solves the
parser issue for #14869. So may be I should update my PR to remove the 'Fix #14869' from the comment.

it would be a good idea :)

@nomuna
Copy link
Contributor Author

nomuna commented Jun 6, 2021

Hi @MathieuAA,

do you have a write access? Are you supposed to merge it or should I request for someone in the jhipster chat?

Have a nice day.

@MathieuAA MathieuAA merged commit 0e4a6e0 into jhipster:main Jun 6, 2021
@pascalgrimaud pascalgrimaud added this to the 7.1.0 milestone Jun 11, 2021
@swarajsaaj swarajsaaj mentioned this pull request Jun 15, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jdl enum section cannot have java comments
4 participants