Fix Javadoc handling in Markdown comments - #3849
Merged
Merged
Conversation
Signed-off-by: Morgan Chang <shin19991207@gmail.com>
Contributor
Author
|
Regarding #3690, The following case was mentioned in #3699 (review): /// {@link "some text"}
void method() {}Eclipse IDE renders Which behaviour do we prefer? |
Contributor
|
I think part of writing a custom solution was to avoid having to convert the Markdown to HTML and then back to Markdown. (VS Code expects Markdown for hover content, whereas Eclipse expects HTML). Knowing this, do you still think it's worth taking your current approach, or do you think it's worth handing the missing tags in the current implementation? |
datho7561
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3695
Fixes #3696
Fixes #3672
Fixes #3690
Originally, JDT LS used a custom renderer for Markdown documentation comments (
///).The renderer manually walked the Javadoc AST, copied text, created links, and formatted a limited set of block tags from https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjdt%2Fcore%2Fdom%2FTagElement.html. This duplicated part of JDT Core's Javadoc rendering logic but did not implement the full semantics of Javadoc tags.
Therefore, tags not explicitly handled by the custom renderer were missing or rendered incorrectly. This included the reported cases for
@inheritDoc,@value,@code... etc.The problem was not specific to the reported cases. Other inline and block tags could also behave differently from traditional Javadoc comments. Adding special cases for individual tags would continue duplicating JDT Core logic and would require every Javadoc tag and its semantics to be reimplemented in JDT LS.
The fix uses JDT Core's Javadoc renderer for Markdown comments that require semantic processing instead of manually rendering their tags in JDT LS.