-
Notifications
You must be signed in to change notification settings - Fork 485
Closed
eclipse-jdtls/eclipse.jdt.ls
#1814Milestone
Description
Organize imports always generates a static import statement, if the current static import is not part of java.completion.favoriteStaticMembers
.
settings.json
"java.completion.favoriteStaticMembers": [
"org.assertj.core.api.Assertions.*"
],
Environment
- Operating System: Ubuntu 18.04.5 LTS (Bionic Beaver)
- JDK version: 11.0.6.hs-adpt
- Visual Studio Code version: 1.57.1
- Java extension version: 0.80.0
Steps To Reproduce
- Configure static imports as explained above
- Checkout https://github.com/fvclaus/vscode-java-import-bug. Import project. Open AppTest.java. Execute
Organize Imports
Developer console contained no error messages.
Java log file contained the following:
!ENTRY org.eclipse.jdt.ls.core 1 0 2021-07-05 17:33:48.321
!MESSAGE >> document/codeAction
!ENTRY org.eclipse.jdt.ls.core 1 0 2021-07-05 17:33:48.324
!MESSAGE >> document/documentSymbol
!ENTRY org.eclipse.jdt.ls.core 1 0 2021-07-05 17:33:48.345
!MESSAGE >> workspace/executeCommand java.project.provideSemanticTokens
!ENTRY org.eclipse.jdt.ls.core 1 0 2021-07-05 17:33:48.504
!MESSAGE Reconciled 1. Took 3 ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2021-07-05 17:33:48.988
!MESSAGE begin problem for /AppTest.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2021-07-05 17:33:48.988
!MESSAGE 1 problems reported for /AppTest.java
!ENTRY org.eclipse.jdt.ls.core 1 0 2021-07-05 17:33:48.989
!MESSAGE Validated 1. Took 83 ms
Current Result
Organize imports always generates a static import statement, even if the symbol is already imported.
Expected Result
Organize import will not generate static imports for symbols that are already imported.
Metadata
Metadata
Assignees
Labels
No labels