-
Notifications
You must be signed in to change notification settings - Fork 401
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 overriding methods not inheriting @param descriptions #1732
Comments
@rgrunber this works in Eclipse, so this is a problem specific to jdt.ls |
I'll try to have look, that is quite odd. |
This seems to have worked correctly in 0.15.0, after which JavadocContentAccess2 was introduced, so it has been an issue since. I think to really undestand why it's going wrong, it'd be best to compare with Eclipse's approach, which probably does things correctly. I think the code before 0.15.0 just looked up the method being overriden in the hierarchy and directly used that javadoc. The current implementation attempts to rebuild a lot of the javadoc from the various components of the method, and I'm not entirely sure why. With that said, we could also just fix the existing code for now.. The problem happens at https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/javadoc/JavadocContentAccess2.java#L1936 where we need to surround the entire parameter name and description with Here's what the javadoc to be render looks like in both cases : param description is displayed
param description is not displayed
|
wow you really went all the way back to 0.15.0?? |
- Surround javadoc @param entry with a block tag entry. - Fixes eclipse-jdtls#1732 - Adjust existing testcase to handle @param description Signed-off-by: Roland Grunberg <[email protected]>
- Surround javadoc @param entry with a block tag entry. - Fixes eclipse-jdtls#1732 - Adjust existing testcase to handle @param description Signed-off-by: Roland Grunberg <[email protected]>
Well, I jumped back based on modifications to JavadocContentAccess2, so there were only about 4 versions to check. I was surprised they all more or less still ran without issue :P |
- Surround javadoc param entry with a block tag entry. - Adjust ending entries for javadoc of param and exception tags - Fixes eclipse-jdtls#1732 - Adjust existing testcase to handle param description Signed-off-by: Roland Grunberg <[email protected]>
- Surround javadoc param entry with a block tag entry. - Adjust ending entries for javadoc of param and exception tags - Fixes #1732 - Adjust existing testcase to handle param description Signed-off-by: Roland Grunberg <[email protected]>
When a method overrides/implements a method from the parent class, the parameter descriptions from
@param
tags in the parent class are not inherited.For example, with the following code:
In the Javadoc hover for
Bar.foo(int)
, the description for the parameteri
is empty (screenshot taken from VS Code with the Language Support for Java plugin, which uses the Eclipse JDT Language Server):For reference, this is what the Javadoc tool outputs:
Which matches the Javadoc tool's documentation, which says that missing
@param
tags should be inherited.Originally I opened an issue in the VS Code plugin's repository: redhat-developer/vscode-java#962, but it seems like this is an issue with the language server/JDT instead. I had a friend who uses coc-java in Neovim, which also uses the JDT Language Server, and he also has the same issue:
The text was updated successfully, but these errors were encountered: