vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Is it possible to have java.util.List on favorite?

Open RMCampos opened this issue 1 year ago • 5 comments

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
  1. Create a blank Java project
  2. Start typing "List"
  3. 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).

Please attach logs No errors to show.

Current Result

It's required to scroll down and look for this package.

Expected Result

Since this is a quite common package, I'd like to see it on top.

Additional Informations

None.

RMCampos avatar Dec 05 '23 16:12 RMCampos

You mean in a case like this ?

import-java-util-list

I don't think this is possible yet, but it's very similar to part of https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/1423, and https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/2484 . In fact the exact same issue (java.util.List being low) is brough up in https://github.com/redhat-developer/vscode-java/discussions/3341#discussioncomment-7341115 ! However, these wouldn't help in a completely empty project as they'd only prioritize imports that have already been used frequently.

rgrunber avatar Dec 12 '23 17:12 rgrunber

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.

image

testforstephen avatar Jan 02 '24 13:01 testforstephen

I have the same problem.

  • Extension Pack for Java: v0.27.2024060717
  • vscode: 1.90.0

meiliangdeng avatar Jun 12 '24 08:06 meiliangdeng

I have the same problem.

  • Extension Pack for Java: v0.27.2024060717
  • vscode: 1.90.0 It's strange that it can be imported normally again without upgrading

meiliangdeng avatar Jun 13 '24 02:06 meiliangdeng

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.

dailytabs avatar Jun 29 '24 23:06 dailytabs