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

Auto-import is not suggested for classes with long name #6475

Closed
brndt opened this issue Jun 3, 2024 · 4 comments · Fixed by #6482 or #6531
Closed

Auto-import is not suggested for classes with long name #6475

brndt opened this issue Jun 3, 2024 · 4 comments · Fixed by #6482 or #6531
Labels
bug Something that is making a piece of functionality unusable
Milestone

Comments

@brndt
Copy link

brndt commented Jun 3, 2024

Describe the bug

  1. Create a new class CreateLatestCommentSubscriber
  2. Try to import it in other package
  3. Rename class to CreateLatestCommentByItemSubscriber
  4. Try to import it in other package
  5. Auto-import is not working because of class name length

Expected behavior

Auto-import should be suggested to classes with long name

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

v1.3.1

Extra context or search terms

No response

@kasiaMarek
Copy link
Contributor

Thanks for the report, it seems to be offering the auto import correctly for me:
Screenshot 2024-06-03 at 18 29 27

Which scala version are you using? Also does the rename cause compile errors?

@brndt
Copy link
Author

brndt commented Jun 3, 2024

I'm using Scala 3.4.2

Seems like it also depends on packaging length. Can you try to put it to something like
com.scalaFakePackage.test.latestCommentByItem.domain.projection.latestCommentByItemView.subscriber. CreateLatestCommentByItemSubscriber?

@kasiaMarek kasiaMarek added the bug Something that is making a piece of functionality unusable label Jun 3, 2024
@tgodzik tgodzik moved this to In progress in Metals Issue Board Jun 12, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Metals Issue Board Jun 14, 2024
@kasiaMarek kasiaMarek added this to the Metals v1.3.2 milestone Jun 18, 2024
@brndt
Copy link
Author

brndt commented Jun 18, 2024

@kasiaMarek
I checked it with the latest snapshot of Metals and still can't see auto import suggestions.
For example, com.randomMetalsTest.app.latestCommentByItem.domain.projection.latestCommentByItemView.subscriber.DeleteLatestCommentByItemViewOnLatestCommentByItemDeleted is not suggested.
I tried both Scala 3.3.3 and 3.5.0-RC1.

@kasiaMarek
Copy link
Contributor

Oh, that is even longer than the other example. I have a theory why that may be and I think I have to adjust how bloom index is built even further. 🤔 Reopening this.

@kasiaMarek kasiaMarek reopened this Jun 19, 2024
@github-project-automation github-project-automation bot moved this from Done to Triage in Metals Issue Board Jun 19, 2024
@kasiaMarek kasiaMarek removed this from the Metals v1.3.2 milestone Jun 19, 2024
@kasiaMarek kasiaMarek moved this from Triage to In progress in Metals Issue Board Jun 21, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Metals Issue Board Jun 25, 2024
@tgodzik tgodzik added this to the Metals v1.3.3 milestone Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable
Projects
Archived in project
3 participants