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

Add javadoc for generated constructors #3669

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

Rawi01
Copy link
Collaborator

@Rawi01 Rawi01 commented May 20, 2024

This PR fixes #933

Lombok now adds a javadoc comment to a generated constructor if there is any field with a description.

@archer-321
Copy link

Thanks for working on this feature!

Would it make sense to allow a -- CONSTRUCTOR -- section similar to -- GETTER --? This wouldn't work for classes with multiple constructor annotations unless the syntax is changed to -- ALL CONSTRUCTOR --, -- REQUIRED CONSTRUCTOR -- or similar, but it would allow for more flexible constructor documentation.

Looking at the example generated documentation in the tests, I immediately noticed the capitalization for the @param parameter documentation. Most projects I'm aware of (including the OpenJDK source code) use lowercase descriptions while starting class item documentation with a cardinal letter. More control over the generated constructor documentation would help keep the module documentation uniform.

@Rawi01
Copy link
Collaborator Author

Rawi01 commented Jun 15, 2024

@archer-321 Thanks for the feedback. The intended solution was to copy @param tags to the constructor if they are present. I missed that it doesn't work at all because of different bug that I fixed years ago but was never merged. Cherry picked that commit and it should now work as planned.

@rzwitserloot rzwitserloot merged commit db4e6df into projectlombok:master Jun 27, 2024
55 checks passed
@rzwitserloot
Copy link
Collaborator

Speaking of javadoc, @Rawi01 there's the markdown JEP 467 - the only effect I think that has on lombok is that we should copy the 'this is markdown style' flag to the javadoc node we generate, other than that, I don't think this affects either scanning for --- GETTER --- or scanning for @param / @return, which is unchanged in the markdown flavour. We can only move on this once all relevant tools (javac and ecj I guess) are updated to be capable of handling JEP 467 which probably isn't yet today? I haven't checked.

This does not affect accepting this PR at all, just tangentially related.

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

Successfully merging this pull request may close these issues.

Javadoc for @XArgsConstructor
3 participants