Fix incorrect return value in StaticImportFavoritesCompletionInvoker. #970
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.
@robstryker adopted the latest 4.31-I-builds at eclipse-jdtls/eclipse.jdt.ls#2947, and they uncovered a regression in the organize imports logic : https://ci.eclipse.org/ls/job/jdt-ls-pr/4816/ when triggered in a module file.
Introduced by #927 (in 4.31-I-builds).
Before:
eclipse.jdt.ui/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/JavaModelUtil.java
Lines 1327 to 1331 in 137f84f
After:
eclipse.jdt.ui/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/StaticImportFavoritesCompletionInvoker.java
Lines 84 to 88 in d04cefe
The fix is straightforward.
Update: I've added a testcase. Given that the PR that introduced the regression passed when merged, it's safe to say no tests are triggering "Organize Imports" in module files, so I've added the one we use in JDT-LS.