[main-v2] Replace qdox with javac for Javadoc indexing#8358
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
tgodzik
left a comment
There was a problem hiding this comment.
Some minor comments, but looks pretty good!
|
Could you also take a look at the failing tests? |
f09f88f to
d538655
Compare
|
@tgodzik Thanks for the review! addressed comments and failing tests. |
tgodzik
left a comment
There was a problem hiding this comment.
One minor issue that I just noticed. Thanks for working on this!
JavadocIndexer now extends JavacMtags instead of QdoxJavaMtags, removing the qdox dependency entirely. Added onClass/onMethod/ onConstructor hooks and keepDocComments support to JavacMtags. Uses javac's internal DocCommentTable for robust Javadoc extraction. Introduced JavadocParser for extracting body text and @param tags from raw Javadoc comments. Full raw Javadoc is now passed to MarkdownGenerator so @param, @return, @throws, and @see tags render in hover documentation. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…omment, update test expectations - Remove JavaOutlineProviderConfig setting entirely since javac is now the only provider - Refactor getDocComment in JavacMtags to use idiomatic Scala pattern matching instead of null checks, casts, and early returns - Update test expectations to include newly rendered @param, @return, @throws, and @see Javadoc block tags in hover and signature help output Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Replace sliding(2) disambiguator with a per-name counter so non-adjacent overloads (e.g. String.valueOf interleaved with copyValueOf) get unique SemanticDB symbols instead of colliding. - Filter private constructors from disambiguation and emission, matching the previous qdox behavior. Without this, classes like java.io.File shifted public constructors' disambiguators by 2, causing the PC to read parameter names from the wrong overloads. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
74c2cc0 to
79e1c09
Compare
|
sorry for the delay here! Should be all addressed. |
ScaladocParser's HtmlConverter (Jsoup-based) strips <T> as an unknown HTML tag before the @param regex captures the param name, leaving the next word (e.g. "the", "type") as the captured name. Rewrite Javadoc `@param <T> desc` to Scaladoc `@tparam T desc` before passing the comment to MarkdownGenerator, so type parameters render correctly under Type Parameters and regular params stay under Parameters. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
79e1c09 to
d90e082
Compare
The unconditional private-constructor filter in JavacMtags caused two problems: tests.JavacMtagsExpectSuite's assertCompatWithSemanticdbJavac fails because semanticdb-javac emits private constructors, and the tests/unit/.../mtags/example/JavaClass.java fixture expects them too. The filter is only needed for JavadocIndexer's parameter-name lookup (keyed by `<init>(+N)`), which must match the Scala compiler's view of Java constructors (which excludes private ones). The base JavacMtags should match semanticdb-javac for consistent code navigation. Gate the filter behind a `filterPrivateConstructors` constructor flag, defaulting to false. JavadocIndexer opts in. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The Bazel MBT Java-workspace hover test now sees the `@return` block from Jsoup's Document.title() Javadoc since JavadocIndexer renders block tags. Also drop a leftover Tokens.Comment import from JavacMtags (scalafix). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Context
closes #8349
Pulled out of #8350 -- improve JavaDox indexing while removing last vestige of qdox dep in main-v2.
Summary
QdoxJavaMtags to JavacMtags
JavacMtags so subclasses can extract Javadoc during parsing
from raw Javadoc comments
and @see block tags now render in hover documentation
is now the only Java outline provider)
Context
This is the main-v2 counterpart to the work in #8350. Since main-v2's
JavadocIndexer still relied on qdox, this PR removes that dependency from
v2 as well by reusing the existing JavacMtags javac-based parser with
minimal additions (hooks + doc comment extraction).