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

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

Open
RMCampos opened this issue Dec 5, 2023 · 5 comments
Open

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

RMCampos opened this issue Dec 5, 2023 · 5 comments

Comments

@RMCampos
Copy link

RMCampos commented Dec 5, 2023

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.

@rgrunber
Copy link
Member

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 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.

@testforstephen
Copy link
Collaborator

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

@meiliangdeng
Copy link

I have the same problem.

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

@meiliangdeng
Copy link

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

@dailytabs
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants