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
Is it possible to have java.util.List on favorite? #3414
When trying to import List from java.util (java.util.List) this option is way down in the list of possible packages. Is there any option to make it go up, something like a default or favorite option? (I'm aware of the java.completion.favoriteStaticMembers, that's why I'm asking). Thanks in advance.
Environment
Operating System: Linux
JDK version: 17.0.8
Visual Studio Code version: 1.84.2
Java extension version: 1.25.0
Steps To Reproduce
Create a blank Java project
Start typing "List"
One can see lots of List packages but no java.util.List.
[Please attach a sample project reproducing the error]
No sample project required (IMO).
I don't think this is possible yet, but it's very similar to part of eclipse-jdtls/eclipse.jdt.ls#1423, and eclipse-jdtls/eclipse.jdt.ls#2484 . In fact the exact same issue (java.util.List being low) is brough up in #3341 (comment) ! However, these wouldn't help in a completely empty project as they'd only prioritize imports that have already been used frequently.
This certainly worths optimization. In a typical Spring Boot project (spring-petclinic), numerous List classes from various dependencies are included. However, when typing ‘List’, the suggestion for “java.util.List” does not appear as a top priority, which makes it hard to find the "java.util.List" from intelliSense.
Reacted by R. Campos, MathieuAstek, Roberto, hacke2, vhd-bassford, Dominik Hufnagel, Dmitry Zavodnikov and djj-dk
Using Ctrl+. on the "List" brings up java.util.List, correctly. It is very annoying to have to use a different keystroke to get intelligent completion just for this one class. A solution is needed.
Activity
rgrunber commentedon Dec 12, 2023
You mean in a case like this ?
I don't think this is possible yet, but it's very similar to part of eclipse-jdtls/eclipse.jdt.ls#1423, and eclipse-jdtls/eclipse.jdt.ls#2484 . In fact the exact same issue (
java.util.Listbeing low) is brough up in #3341 (comment) ! However, these wouldn't help in a completely empty project as they'd only prioritize imports that have already been used frequently.testforstephen commentedon Jan 2, 2024
This certainly worths optimization. In a typical Spring Boot project (spring-petclinic), numerous
Listclasses from various dependencies are included. However, when typing ‘List’, the suggestion for“java.util.List”does not appear as a top priority, which makes it hard to find the "java.util.List" from intelliSense.meiliangdeng commentedon Jun 12, 2024
I have the same problem.
meiliangdeng commentedon Jun 13, 2024
dailytabs commentedon Jun 29, 2024
Using
Ctrl+.on the "List" brings upjava.util.List, correctly. It is very annoying to have to use a different keystroke to get intelligent completion just for this one class. A solution is needed.