You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace Google Format unused imports with JavaParser scanning - #12622
Replaces the usage of Google Java Format's unused import removal with JavaParser's scanning and validation to reduce dependencies in the Java TypeSpec generator and to allow shrinking shipped package size.
Replaces Google Java Format’s unused-import removal with JavaParser analysis in the Java client generator, aiming to reduce runtime dependencies and shipped package size while retaining Eclipse formatting.
Use JavaParser for unused-import removal, eliminating Google Java Format and its runtime dependencies along with the generator's --add-exports JVM options.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The formatter can remove imports needed by nested Javadoc references or declaration comments separated by blank lines, leaving unresolved links that can fail doclint.
With import java.util.List; and /** {@link List} */ separated from the following class declaration by a blank line, this check drops the import and leaves an unresolved Javadoc link: JavaParser's default configuration leaves that comment unattributed. Preserve references in declaration Javadoc across blank lines, without retaining actual orphan comments or mutating the caller's parser settings, and add a regression case.
A valid comment such as /** {@summary Uses {@link List}.} */ loses its List import because only the outer summary tag is examined; these inline tags are preserved by model/javamodel/JavaJavadocComment.java:30–32. Please inspect nested references in tags that allow them (without interpreting code or literal contents as references) and add a regression case, otherwise generated or customized Javadoc can acquire unresolved links and fail doclint.
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
emitter:client:javaIssue for the Java client emitter: @typespec/http-client-java
2 participants
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.
Replaces the usage of Google Java Format's unused import removal with JavaParser's scanning and validation to reduce dependencies in the Java TypeSpec generator and to allow shrinking shipped package size.