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

Support quickfix for gradle jpms projects #2304

Merged
merged 3 commits into from
Jan 9, 2023

Conversation

CsCherrYY
Copy link
Contributor

@CsCherrYY CsCherrYY commented Nov 1, 2022

Signed-off-by: Shi Chen [email protected]

related to redhat-developer/vscode-java#2773

Gradle provides better JPMS support since 7.0, see: gradle/gradle#890 (comment), which means the Gradle versions under 7.0 might cause some issues, and the user will see errors such as "xxx is not accessible".

See gradle/gradle#16922, Gradle 7.0.1 added an extra fix about JPMS projects, so 7.0.1 is a better recommendation version IMO.

this PR provides a quickfix to help users upgrade the gradle version.

action.mp4

@CsCherrYY
Copy link
Contributor Author

@rgrunber @testforstephen @jdneo I have addressed the conflicts and updated the descriptions. feel free to review and comment :)

try {
ClasspathResult result = ProjectCommand.getClasspathsFromJavaProject(javaProject, new ProjectCommand.ClasspathOptions());
IModuleDescription moduleDescription = javaProject.getModuleDescription();
if (moduleDescription == null) {
Copy link
Contributor

@jdneo jdneo Dec 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest extracting the code in if-else blocks to methods separately - for better readiness.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in daf2a76

@CsCherrYY
Copy link
Contributor Author

Since this issue related to the Gradle versions under Gradle 7, which do not support the current test environment (Java 17), so the test cases can't be added until we support running tests in another Java version.

@CsCherrYY CsCherrYY merged commit c4ed39a into eclipse-jdtls:master Jan 9, 2023
@CsCherrYY CsCherrYY deleted the cs-gradle-jpms branch January 9, 2023 04:11
@rgrunber rgrunber added this to the Mid January 2023 milestone Jan 16, 2023
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.

3 participants